Skip to content

[WIP] Error message type aliasing - built out aliasTypeMap and in the…#3069

Draft
olivrlee wants to merge 1 commit intoapache:mainfrom
olivrlee:olivrlee/error_message_aliasing
Draft

[WIP] Error message type aliasing - built out aliasTypeMap and in the…#3069
olivrlee wants to merge 1 commit intoapache:mainfrom
olivrlee:olivrlee/error_message_aliasing

Conversation

@olivrlee
Copy link
Contributor

… 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;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using this babel quidem test to test error messages because CalciteSqlOperatorTest uses MockCatalogReader

}
return functions2;
}
// public @Nullable SqlIdentifier getNameFromType(RelDataType type) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore this

call.getCallSignature(validator, scope),
getOperator().getAllowedSignatures()));
// getOperator().getAllowedSignatures()));
getOperator().getAllowedSignaturesUsingValidator(validator)));
Copy link
Contributor Author

@olivrlee olivrlee Feb 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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){
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is another important function where given a Calcite type we return the dialects reverse aliased type
(i.e. calcite TIMESTAMP -> bigquery DATETIME)

@github-actions
Copy link

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.

@github-actions
Copy link

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.

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.

1 participant