-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-45070][SQL][DOCS] Describe the binary and datetime formats of to_char/to_varchar
#42801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
to_char/to_varcharto_char/to_varchar
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/functions.scala
Show resolved
Hide resolved
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, LGTM.
| * <li>'base64': a base 64 string.</li> | ||
| * <li>'hex': a string in the hexadecimal format.</li> | ||
| * <li>'utf-8': the input binary is decoded to UTF-8 string.</li> | ||
| * </ul> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To @MaxGekk , it seems our Linter CI doesn't allow this kind of human-friendly formatting in the comment.
The scalafmt check failed on connector/connect at following occurrences:
Requires formatting: functions.scala
Before submitting your change, please make sure to format your code using the following command:
./build/mvn -Pscala-2.12 scalafmt:format -Dscalafmt.skip=false -Dscalafmt.validateOnly=false -Dscalafmt.changedOnly=false -pl connector/connect/common -pl connector/connect/server -pl connector/connect/client/jvm
Error: Process completed with exit code 1.
The recommended style is something like the following. Please fix the style by run the above command line.
- * brackets if the input value is negative.</li> </ul>
- * If `e` is a datetime, `format` shall be a valid datetime pattern, see
- * <a href="https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html">Datetime Patterns</a>.
- * If `e` is a binary, it is converted to a string in one of the formats:
- * <ul>
- * <li>'base64': a base 64 string.</li>
- * <li>'hex': a string in the hexadecimal format.</li>
- * <li>'utf-8': the input binary is decoded to UTF-8 string.</li>
- * </ul>
+ * brackets if the input value is negative.</li> </ul> If `e` is a datetime, `format` shall be
+ * a valid datetime pattern, see <a
+ * href="https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html">Datetime
+ * Patterns</a>. If `e` is a binary, it is converted to a string in one of the formats: <ul>
+ * <li>'base64': a base 64 string.</li> <li>'hex': a string in the hexadecimal format.</li>
+ * <li>'utf-8': the input binary is decoded to UTF-8 string.</li> </ul>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @dongjoon-hyun
|
Merging to master. Thank you, @dongjoon-hyun and @cloud-fan for review. |
What changes were proposed in this pull request?
In the PR, I propose to document the recent changes related to the
formatof theto_char/to_varcharfunctions:to_charfor the formats:hex,base64,utf-8#42632to_char/to_varchar#42534Why are the changes needed?
To inform users about recent changes.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
By CI.
Was this patch authored or co-authored using generative AI tooling?
No.