cloud-fan commented on a change in pull request #27956: [SPARK-31189][SQL][DOCS] Fix errors and missing parts for datetime pattern document URL: https://github.com/apache/spark/pull/27956#discussion_r395104326
########## File path: docs/sql-ref-datetime-pattern.md ########## @@ -199,18 +231,28 @@ The count of pattern letters determines the format. - Number/Text: If the count of pattern letters is 3 or greater, use the Text rules above. Otherwise use the Number rules above. -- Fraction: Outputs the micro-of-second field as a fraction-of-second. The micro-of-second value has six digits, thus the count of pattern letters is from 1 to 6. If it is less than 6, then the micro-of-second value is truncated, with only the most significant digits being output. +- Fraction: Use one or more contiguous `'S'` characters, e,g `SSSSSS`, to parse and format fraction of second. + For parsing, the acceptable fraction length can be [1, the number of contiguous 'S']. + For formatting, the fraction length would be padded to the number of contiguous 'S' with zeros. + Spark supports datetime with max precision to micro-of-second which has 6 significant digits at most, but can parse nano-of-second field which can accept 9 contiguous 'S' at most with exceeded part truncated. Review comment: Let's simplify it a bit ``` Spark supports datetime of micro-of-second precision, which has up to 6 significant digits. but can parse nano-of-second with exceeded part truncated. ``` Let's mention the length limit when we introduce 'S', as it applies to formatting as well ``` Fraction: Use one or more contiguous `'S'` characters (up to 9 contiguous 'S'), e,g `SSSSSS`, ... ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
