[WIP] Error message type aliasing - built out aliasTypeMap and in the…#3069
[WIP] Error message type aliasing - built out aliasTypeMap and in the…#3069olivrlee wants to merge 1 commit intoapache:mainfrom
Conversation
… middle of testing extraction
| TIMESTAMP "2010-07-07 10:20:00" AS later_timestamp, | ||
| TIMESTAMP "2008-12-25 15:30:00" AS earlier_timestamp, | ||
| TIMESTAMP_DIFF(TIMESTAMP "2010-07-07 10:20:00", TIMESTAMP "2008-12-25 15:30:00", HOUR) AS hours; | ||
| TIMESTAMP_DIFF(1, TIMESTAMP "2008-12-25 15:30:00", HOUR) AS hours; |
There was a problem hiding this comment.
Using this babel quidem test to test error messages because CalciteSqlOperatorTest uses MockCatalogReader
| } | ||
| return functions2; | ||
| } | ||
| // public @Nullable SqlIdentifier getNameFromType(RelDataType type) { |
| call.getCallSignature(validator, scope), | ||
| getOperator().getAllowedSignatures())); | ||
| // getOperator().getAllowedSignatures())); | ||
| getOperator().getAllowedSignaturesUsingValidator(validator))); |
There was a problem hiding this comment.
the idea is that this function will pass through validator which we'll use to check for all types if they have aliases newValidationSignatureError
| } | ||
|
|
||
|
|
||
| public static void populateAliasTypeMap(BiMap<TypeEntry, String> aliasTypeMap, |
There was a problem hiding this comment.
this would be the populating of the type aliases from the schema, it currently doesn't handle non-unique type names yet which needs fixing
There was a problem hiding this comment.
I'm a bit unsure on whats the types I should be indexing in and out so that we have most versatility when retrieving (I'd imagine doing String <-> String we lose a lot of info)
| // } | ||
| // return null; | ||
| // } | ||
| public static String getAliasedTypeName(SqlValidator validator, String typeName){ |
There was a problem hiding this comment.
this is another important function where given a Calcite type we return the dialects reverse aliased type
(i.e. calcite TIMESTAMP -> bigquery DATETIME)
8a5cf83 to
cf7f71b
Compare
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@calcite.apache.org list. Thank you for your contributions. |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@calcite.apache.org list. Thank you for your contributions. |
… middle of testing extraction