forked from OHDSI/SqlRender
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Merge changes from upstream #1
Open
myounglai
wants to merge
141
commits into
hajarhomayouni:master
Choose a base branch
from
myounglai:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fix of LOG10 for Redshift
Merge branch 'master' of https://github.com/OHDSI/SqlRender Conflicts: .Rbuildignore
Add Impala SQL dialect. Fixes OHDSI#39.
…nslation rules (for those using the standalone JAR file).
Update replacementPatterns.csv
Netezza test
Escape 'location' table name in Impala since it's a reserved word.
…trated by implementing rules for SELECT TOP translation.
…I#71) * try testing sqlRender * add some translations for googlebigquery in replacementPatterns.csv * update replacementPatterns.csv * add mysql to csv * add mysql to csv * edit csv file for mysql * update queries with temp tables for mysql * no table definition is required in creating temp tables in mysql * update csv file for mysql * csv mysql * csv mysql * try to resolve an error in mysql * change order for mysql translations * translate row_number in mysql * row number translation update * csv update * update csv * csv update * update and add some general rules for mysql * translate simple insert into gbq * insert translation to gbq * insert trans for GBQ * drop table trans into GBQ * drop trans into GBQ * update drop trans onto GBQ * create table trans into gbq * update * update create translation to gbq * insert trans into gbq * insert with different number of columns for gbq * double quota issue in csv file * double quotes issue gbq * select-insert query trans for gbq * add semicolon to the end of query gbq * add semicolons to all queries * select with where cluase trans into gbq * add with as query trans into gbq * add \n to the end of queries * remove # from table names * drop trans for gbq * resolve a syntax error * bigint trans to gbq * float trans into gbq * remove float for an error * replace " with ' gbq * double quetos issue (replace with \") * float trans into gbq * try to resolve translation problem for float in GBQ * enabled standard sql for GBQ * add cast trans for gbq * cast in gbq * added translated year to UTC_USEC_TO_YEAR for gbq * added extract dates in gbq * at64 in standard sql in GBQ * date_diff * date_diff * added date functions to GBQ * add a personal trans for gbq * personal trans for gbq * concat for gbq * concat for gbq * concat solution * concat * concat * concat * concat * concat * concat * concat * concat * concat * concat * concat * concat * concat * add more for concat * concat * concat * concat * add preprocess function * changed rp for concat * add paranthesis for concate * concat * concat * cast * concat * add standard sql to GBQ * Change "googlebigquery" identifier to "bigquery". * Remove replacement patterns that lead to infinite loop. These aren't needed because standard sql can be specified in the jdbc url. * Fix relative path for test. * Changes corresponding to new DDL statement support in starschema. * Remove type translation that is done in the driver. * Lowercase all statements. * Move lowercasing of statements until after the rest of translation. * Combine lines. * Add output for debugging. * Fix typo * Move lowercasing earlier. * Try another fix. * Try explicit locale. * Try tolower in R code. * Decompose subtraction and extract operators in group by. * Common table expressions and group by rewrites. * Change to using GROUP BY matching against the select list rather than GROUP BY flattening. Add a few more rewrite rules needed for achilles queries. * Revert extraneous diffs in preparation for creating pull request. * Revert more diffs. * More reverts. * Start adding unit tests for bigquery. * Remove concat rewrite rules that are no longer needed. * Add lowercasing for bigquery. * More unit tests. * Add some comments. * Fix bug in parse_date rewrite introduced by cleanup. * Rewrite string concatenations to use CONCAT. * More tests and skip group by replacement for simple expressions. * Simplify GROUP BY rewrites. * More changes needed to run heel script. * Revert test change. * Update jar. * Add lowercasing of everything but string literals. * Exclude row_number from group by translation. * Support for ifnull. More patterns for recognizing string concats. * Fix unit test. * Add pattern for CONCAT recognition. * Fix direction of isnull/ifnull translation. * Handle aliases without AS at the end of CONCAT expressions. * Add concat rule for CASE expression. * Detect string in second position for CONCAT.
…select list. However, skip matching when the expression is a single column reference.
* try testing sqlRender * add some translations for googlebigquery in replacementPatterns.csv * update replacementPatterns.csv * add mysql to csv * add mysql to csv * edit csv file for mysql * update queries with temp tables for mysql * no table definition is required in creating temp tables in mysql * update csv file for mysql * csv mysql * csv mysql * try to resolve an error in mysql * change order for mysql translations * translate row_number in mysql * row number translation update * csv update * update csv * csv update * update and add some general rules for mysql * translate simple insert into gbq * insert translation to gbq * insert trans for GBQ * drop table trans into GBQ * drop trans into GBQ * update drop trans onto GBQ * create table trans into gbq * update * update create translation to gbq * insert trans into gbq * insert with different number of columns for gbq * double quota issue in csv file * double quotes issue gbq * select-insert query trans for gbq * add semicolon to the end of query gbq * add semicolons to all queries * select with where cluase trans into gbq * add with as query trans into gbq * add \n to the end of queries * remove # from table names * drop trans for gbq * resolve a syntax error * bigint trans to gbq * float trans into gbq * remove float for an error * replace " with ' gbq * double quetos issue (replace with \") * float trans into gbq * try to resolve translation problem for float in GBQ * enabled standard sql for GBQ * add cast trans for gbq * cast in gbq * added translated year to UTC_USEC_TO_YEAR for gbq * added extract dates in gbq * at64 in standard sql in GBQ * date_diff * date_diff * added date functions to GBQ * add a personal trans for gbq * personal trans for gbq * concat for gbq * concat for gbq * concat solution * concat * concat * concat * concat * concat * concat * concat * concat * concat * concat * concat * concat * concat * add more for concat * concat * concat * concat * add preprocess function * changed rp for concat * add paranthesis for concate * concat * concat * cast * concat * add standard sql to GBQ * Change "googlebigquery" identifier to "bigquery". * Remove replacement patterns that lead to infinite loop. These aren't needed because standard sql can be specified in the jdbc url. * Fix relative path for test. * Changes corresponding to new DDL statement support in starschema. * Remove type translation that is done in the driver. * Lowercase all statements. * Move lowercasing of statements until after the rest of translation. * Combine lines. * Add output for debugging. * Fix typo * Move lowercasing earlier. * Try another fix. * Try explicit locale. * Try tolower in R code. * Decompose subtraction and extract operators in group by. * Common table expressions and group by rewrites. * Change to using GROUP BY matching against the select list rather than GROUP BY flattening. Add a few more rewrite rules needed for achilles queries. * Revert extraneous diffs in preparation for creating pull request. * Revert more diffs. * More reverts. * Start adding unit tests for bigquery. * Remove concat rewrite rules that are no longer needed. * Add lowercasing for bigquery. * More unit tests. * Add some comments. * Fix bug in parse_date rewrite introduced by cleanup. * Rewrite string concatenations to use CONCAT. * More tests and skip group by replacement for simple expressions. * Simplify GROUP BY rewrites. * More changes needed to run heel script. * Revert test change. * Update jar. * Add lowercasing of everything but string literals. * Exclude row_number from group by translation. * Support for ifnull. More patterns for recognizing string concats. * Fix unit test. * Add pattern for CONCAT recognition. * Fix direction of isnull/ifnull translation. * Handle aliases without AS at the end of CONCAT expressions. * Add concat rule for CASE expression. * Detect string in second position for CONCAT. * Factor out a class for iterating comma separated expression lists. * Change GROUP BY matching back to searching for the expression in the select list. However, skip matching when the expression is a single column reference. * More refactoring to prepare to use the same GROUP BY rewriting code on ORDER BY. * Rewrite complex expression to select list indexes in ORDER BY. * Handle case where final semi-colon is missing.
…@myl-google : please try to use this class in future pull requests.
* Add translations for Redshift. * Handle type of distribution of tables in Redshift. If '--HINT DISTRIBUTE_ON_KEY(column)' is specified or table definition contains persion_id, subject_id or analysis_id column, DISTKEY(column) is used. Otherwise, DISTSTILE ALL is used. * More DATEADD, DATEDIFF, DATEPART translations for Redshift. * DISTINCT + TOP translation for Redshift. * Add rules for Redshift and Postgres to explicitly cast string literals within CTE to character type to avoid error when this literal participates in ORDER BY clause (issue OHDSI#66). * Add rule to prevent 'Divide by zero' error in Redshift. * Update translation rule for ISNUMERIC function for Redshift. * Add another test for CONCAT in Redshift. * Cast to int 'interval' argument in DATEADD function in Redshift. SQL Server accepts non-integer values as interval for DATEADD function, but Redshift does not. * Fix leaping over a token which follows after regex variable content. * Take column aliases into account when distributing by person_id, subject_id and analysis_id columns. * Add SORTKEY where DISTKEY is added for Redshift. * Redshift translation for bitwise XOR operator. * Revert "Add SORTKEY where DISTKEY is added for Redshift." This reverts commit de46224. * Add 'SORT_ON_KEY' hint for Redshift to control whether SORTKEY should be added.
…hat PDW now does support NEWID() and RAND()
Conflicts: DESCRIPTION inst/java/SqlRender.jar
This rule affected GROUP BY clause which may lead to 'column must appear in the GROUP BY clause or be used in an aggregate function' error.
Remove 'Prevent Divide by zero error' translation rule (issue OHDSI#75).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.