Want STRING but got TEXT #3493
-
sqlglot==23.15.8 newest |
Beta Was this translation helpful? Give feedback.
Answered by
georgesittas
May 16, 2024
Replies: 1 comment
-
They are converted into >>> import sqlglot
>>> sqlglot.transpile("cast(x as string)", "spark")
['CAST(x AS STRING)'] Check out https://github.com/tobymao/sqlglot/blob/main/posts/ast_primer.md |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
georgesittas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
They are converted into
TEXT
because you didn't supply an output dialect. My guess is that you're doingstr(ast)
which invokes the.sql()
method without a dialect. Tryast.sql("spark")
ortranspile(sql, "spark")
.Check out https://github.com/tobymao/sqlglot/blob/main/posts/ast_primer.md