Skip to content
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

Replace FunctionFieldReferenceOperator with Calcite DOT operator #1

Draft
wants to merge 12 commits into
base: single-unions
Choose a base branch
from

Conversation

KevinGe00
Copy link
Owner

@KevinGe00 KevinGe00 commented Jul 15, 2024

What changes are proposed in this pull request, and why are they necessary?

We can get rid of FunctionFieldReferenceOperator entirely and replace it with Calcite's default SqlDotOperator. Historically FunctionFieldReferenceOperator was introduced because "Calcite DOT operator by default does not work for referencing fields from struct return types of functions." However, that's no longer the case, thus rendering FunctionFieldReferenceOperator unneeded. If we can get rid of FunctionFieldReferenceOperator, we also no longer need to migrate it (as part of Coral IR upgrades).

How was this patch tested?

  • clean build
  • ran regression tests for avro, trino and spark
    Only regression I'm seeing is a cosmetic one that is actually desirable. Unnecessary parentheses introduced because FunctionFieldReferenceOperator is not a native Calcite operator go away:
old: (coalesce_struct(lithograph_etl.contentmetadata).tag_1).legacyhelpcenteranswerid
new: coalesce_struct(lithograph_etl.contentmetadata).tag_1.legacyhelpcenteranswerid

@KevinGe00 KevinGe00 changed the title Replace FunctionFieldReferenceOperator with Sql DOT operator Replace FunctionFieldReferenceOperator with DOT operator Jul 15, 2024
@KevinGe00 KevinGe00 changed the title Replace FunctionFieldReferenceOperator with DOT operator Replace FunctionFieldReferenceOperator with Calcite DOT operator Jul 15, 2024
KevinGe00 and others added 10 commits July 16, 2024 17:03
…former (linkedin#512)

* fix redundant transforms/casts

* spotless

* fix fuzzyunionsqlrewriter incorrect struct type when building structs

* remove unused

* spotless

* spotless
* add precision for int and bigint for hive type system

* use static final variables for precisions

* spotless check

* fix converting type to typespec bug

* add UT

* add tinyint and smallint precisions

* spotless

* spotless

* spotless

* new UTs

* add tableInt to rel to trino tests

* spotless

* remove redundant test
* fix single uniontypes in Coral

* remove SingleUnionFieldReferenceTransformer

* remove field reference fix to put in separate PR

* spotless

* update comments

* fix comment + add single uniontype test for RelDataTypeToHiveTypeStringConverter

* spotless

* improve Javadoc for ExtractUnionFunctionTransformer

* use html brackets in javadoc
… conversion (linkedin#521)

* temp

* temp

* use coralsqldialect in trino reltosql

* Import class not member
…ence on UDF calls (linkedin#510)

* fix field reference bug in coral schema

* bring back override tag

* address nits
@KevinGe00 KevinGe00 changed the base branch from single-unions to master July 31, 2024 22:51
@KevinGe00 KevinGe00 changed the base branch from master to single-unions July 31, 2024 22:52
@KevinGe00 KevinGe00 force-pushed the migrate-func-field-ref branch from 8a4f50c to 7602c2e Compare July 31, 2024 23:38
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.

3 participants