Skip to content

Commit

Permalink
enable json functions (#1037)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrivachev authored Jun 29, 2023
1 parent 7e402bc commit c3f989d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions e2e/projects/test-fixture/models/complex_query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ select
row_number() over (partition by d) as row_n,
et._file_name as fn,
parse_json('{"id":23}') as json_data,
bool(null),
safe.bool(JSON '123'),
float64(JSON '9.8'),
json_extract_array('{"a.b": {"c": ["world"]}}', "$['a.b'].c"),
from referrers r
inner join `singular-vector-135519`.dbt_ls_e2e_dataset.student_details d on d.id = r.user_id
inner join `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT j on j.project_number = r.user_id
Expand Down
1 change: 1 addition & 0 deletions server/src/ZetaSqlApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export class ZetaSqlApi {
featuresForVersion.forEach(f => options.enableLanguageFeature(f));
options.enableLanguageFeature(LanguageFeature.FEATURE_NAMED_ARGUMENTS);
options.enableLanguageFeature(LanguageFeature.FEATURE_JSON_TYPE);
options.enableLanguageFeature(LanguageFeature.FEATURE_JSON_VALUE_EXTRACTION_FUNCTIONS);
options.enableLanguageFeature(LanguageFeature.FEATURE_INTERVAL_TYPE);
// https://github.com/google/zetasql/issues/115#issuecomment-1210881670
options.options.reservedKeywords = ['QUALIFY'];
Expand Down

0 comments on commit c3f989d

Please sign in to comment.