Fix literal type handling to be SQL compatible#11749
Fix literal type handling to be SQL compatible#11749Jackie-Jiang wants to merge 2 commits intoapache:masterfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #11749 +/- ##
============================================
+ Coverage 63.13% 63.22% +0.08%
- Complexity 1117 1118 +1
============================================
Files 2342 2342
Lines 125916 126017 +101
Branches 19370 19409 +39
============================================
+ Hits 79501 79675 +174
+ Misses 40749 40675 -74
- Partials 5666 5667 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
022b0bf to
a67df16
Compare
|
Use int literal is backward incompatible because server side expects long literal for int values. This PR fixes the server side to support both int and long literal. Tracking the changes required for int literal in #11751 |
There was a problem hiding this comment.
why transient? This class is not serializable, right?
There was a problem hiding this comment.
Correct. Added transient for documentation purpose and future proof because it is not included in equals() and hashCode(). Certain tools such as EqualsVerifier won't pass if a non-transient field is not used.
There was a problem hiding this comment.
nit: I would prefer javadoc comments. They are included in IDE documentation, while single line comments are not
1d98d7a to
2fa9e7f
Compare
4726b82 to
75d590f
Compare
75d590f to
adaab9f
Compare
|
This PR has become too large. Breaking this PR into smaller PRs and keep it for future reference:
|
Currently when literal is single quoted (e.g.
'abc','123','1.23'), the type is auto-derived based on the literal itself. Also, it can only derive to big-decimal, timestamp or string but not other numeric types.In Standard SQL (we reference PostgreSQL convention as standard), single quoted literal has unknown type and the type should be resolved based on the context around the literal (read more here).
This PR:
CASEto follow the PostgreSQL convention (read more here), and fix a bug of reading float value as double typetoString()to properly reflect the literal typeDeployment
Must deploy broker before server (following the deployment convention)