Jim Apple has posted comments on this change. ( http://gerrit.cloudera.org:8080/11075 )
Change subject: IMPALA-4690: [DOCS] More content for CONV() ...................................................................... Patch Set 2: (9 comments) http://gerrit.cloudera.org:8080/#/c/11075/2/docs/topics/impala_math_functions.xml File docs/topics/impala_math_functions.xml: http://gerrit.cloudera.org:8080/#/c/11075/2/docs/topics/impala_math_functions.xml@228 PS2, Line 228: a 2's compliment of -17 in base 2 This is somewhat opaque. What it seems to be doing is interpret -17 as an unsigned, aka as 2^64 - 17, then interpreting that number, 2^64 - 17, in the given base. Maybe call conv(-17, 10, 10)? http://gerrit.cloudera.org:8080/#/c/11075/2/docs/topics/impala_math_functions.xml@229 PS2, Line 229: </li> So what happens if we run conv('-17', 10, 2)? http://gerrit.cloudera.org:8080/#/c/11075/2/docs/topics/impala_math_functions.xml@234 PS2, Line 234: format="html" scope="external">Negative Base</xref> for more Since Impala does NOT use the system referenced in this link, I think the doc should clearly spell out that we do not use this, maybe in a footnote. http://gerrit.cloudera.org:8080/#/c/11075/2/docs/topics/impala_math_functions.xml@256 PS2, Line 256: Negative-base : systems can accommodate all the same numbers as standard : place-value systems, but both positive and negative numbers are : represented without the use of a <xref : href="https://en.wikipedia.org/wiki/Minus_sign" format="html" : scope="external">minus sign</xref> I do not think Impala uses a negative base system. Otherwise the call above, conv(-17, 10, -2), would return '110011', not '-10001'. http://gerrit.cloudera.org:8080/#/c/11075/2/docs/topics/impala_math_functions.xml@266 PS2, Line 266: than maximum nit: "than the maximum" http://gerrit.cloudera.org:8080/#/c/11075/2/docs/topics/impala_math_functions.xml@271 PS2, Line 271: represents a signed number I'm not sure what this means. Does the string '0' represent a signed number? The string '1'? The number 0? The number 1? http://gerrit.cloudera.org:8080/#/c/11075/2/docs/topics/impala_math_functions.xml@279 PS2, Line 279: If <codeph>a</codeph> does not represent a valid number in : <codeph>from_base</codeph> Here is where it would help to give the parameters different names from each other. What would it mean for a numeric a to be an invalid number in a base 5 system? http://gerrit.cloudera.org:8080/#/c/11075/2/docs/topics/impala_math_functions.xml@280 PS2, Line 280: the digits in <codeph>a</codeph> from : left-to-right are evaluated and used if a valid digit in : <codeph>from_base</codeph> nit: "the invalid digits are ignored." http://gerrit.cloudera.org:8080/#/c/11075/2/docs/topics/impala_math_functions.xml@286 PS2, Line 286: converted nit: "is converted". -- To view, visit http://gerrit.cloudera.org:8080/11075 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4e424fd5a009ff5aa2d35a403e08fcd33c75fec5 Gerrit-Change-Number: 11075 Gerrit-PatchSet: 2 Gerrit-Owner: Alex Rodoni <arod...@cloudera.com> Gerrit-Reviewer: Alex Rodoni <arod...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Jim Apple <jbapple-imp...@apache.org> Gerrit-Comment-Date: Tue, 31 Jul 2018 21:44:55 +0000 Gerrit-HasComments: Yes