-
Notifications
You must be signed in to change notification settings - Fork 5
DT-1701: Improve Snapshot by Query error message #1974
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
base: develop
Are you sure you want to change the base?
Changes from 2 commits
946acb7
547e7a4
7879be1
c6d7c24
d282056
1fb8927
2717fc1
24d109e
cfbc2e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
import bio.terra.common.PdaoConstant; | ||
import bio.terra.grammar.DatasetAwareVisitor; | ||
import bio.terra.grammar.SQLParser; | ||
import bio.terra.grammar.exception.InvalidQueryException; | ||
import bio.terra.model.DatasetModel; | ||
import bio.terra.model.SnapshotModel; | ||
import bio.terra.service.snapshotbuilder.query.TableNameGenerator; | ||
|
@@ -16,6 +17,12 @@ public BigQueryVisitor(Map<String, DatasetModel> datasetMap) { | |
} | ||
|
||
public String generateAlias(String datasetName, String tableName) { | ||
snf2ye marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (datasetName == null || tableName == null) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it's possible for If this check is done in the caller, then we have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great catch, thank you so much! |
||
throw new InvalidQueryException( | ||
"All column and table names must be qualified with a dataset/table name. " | ||
+ "Please ensure that your query uses the format `dataset.table.column` for columns and `dataset.table` for tables. " | ||
+ "For example, use `my_dataset.my_table.my_column` instead of just `my_column` and `my_dataset.my_table` instead of just `my_table`."); | ||
} | ||
return "alias" + Math.abs(Objects.hash(datasetName, tableName)); | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.