fix(redshift): roundtrip support for CURRENT_USER_ID and USER#7633
Conversation
geooo109
left a comment
There was a problem hiding this comment.
@fivetran-kwoodbeck USER is a synonym for CURRENT_USER in redshift USER docs. As a result, we can map the USER to CURRENT_USER here to simplify things. (we have already support for CURRENT_USER). We do this for other dialects, check here. Let me know if this works.
SQLGlot Integration Test ResultsComparing:
By Dialect
Overallsqlglot:cold-prql-test: 101037 total, 101036 passed (pass rate: 100.0%), sqlglot version: sqlglot:fix/redshift-current_user_id: 101037 total, 101037 passed (pass rate: 100.0%), sqlglot version: Transitions: ✅ 61 test(s) passed |
e92cfd3 to
9ab2e73
Compare
@geooo109 Sounds good, it's been updated |
9ab2e73 to
030eff6
Compare
627fa29 to
e075a2a
Compare
SELECT USERandSELECT CURRENT_USER_IDwere being quoted as"USER"and"CURRENT_USER_ID"because they were treated as reserved-word identifiers. Both are Redshift pseudo-columns that should parse and generate as bare keywords. Additionally, user used as a table name (e.g.FROM salesforce.user) was causing a ParseError.