Skip to content
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

Refactor: preserve the full text of hex/bin literals #1552

Merged
merged 6 commits into from
May 5, 2023

Conversation

georgesittas
Copy link
Collaborator

@georgesittas georgesittas commented May 4, 2023

xref duneanalytics/harmonizer#41

cc: @vegarsti this should simplify your hex string handling in harmonizer.

@georgesittas georgesittas requested review from tobymao and crericha May 4, 2023 19:51
@vegarsti
Copy link
Contributor

vegarsti commented May 4, 2023

Awesome, thanks so much!

@georgesittas georgesittas changed the title Feat: refactor hex/bit literals so that their text is preserved Refactor: preserve the full text of hex/bin literals May 4, 2023
sqlglot/dialects/dialect.py Outdated Show resolved Hide resolved
sqlglot/dialects/dialect.py Outdated Show resolved Hide resolved
sqlglot/generator.py Outdated Show resolved Hide resolved
@georgesittas georgesittas merged commit 951d407 into main May 5, 2023
@georgesittas georgesittas deleted the jo/refactor_literals branch May 5, 2023 17:28
@vegarsti
Copy link
Contributor

vegarsti commented May 9, 2023

Eagerly looking forward to this being released 👀

vegarsti added a commit to duneanalytics/harmonizer that referenced this pull request May 10, 2023
)

#41 and related issues were worked around, but SQLGlot 2.12 includes a
[refactor](tobymao/sqlglot#1552) which helps us
get rid of that.
adrianisk pushed a commit to adrianisk/sqlglot that referenced this pull request Jun 21, 2023
* Feat: refactor hex/bit literals so that their text is preserved

* Convert hex/bin values by default, make meta class attr setting more robust

* Fix parsing for dialects that don't support HEX/BIT_STINGS

* Refactor

* Apply suggestion

* Simplify generator check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants