flink icon indicating copy to clipboard operation
flink copied to clipboard

[FLINK-37923][sql] Introduce VARIANT type and PARSE_JSON to Flink SQL

Open Sxnan opened this issue 6 months ago • 3 comments

What is the purpose of the change

This pull request introduces the Variant data structure to represent semi-structured data, a new SQL type variant, and a builtin method to parse json string to the variant type.

Brief change log

  • Patch calcite to support variant type
  • Introduce Variant and BinaryVariant
  • Introduce variant type and PARSE_JSON to Flink SQL

Verifying this change

This change added tests and can be verified.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): yes
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? JavaDocs

Sxnan avatar Jun 09 '25 15:06 Sxnan

CI report:

  • 9513d8eeb67c4b79c2b93437933a28a0630807f3 Azure: SUCCESS
Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

flinkbot avatar Jun 09 '25 15:06 flinkbot

@twalthr Thanks for the detailed review! I updated the PR accordingly, and all the comments should be addressed. Please take another look.

Sxnan avatar Jun 12 '25 15:06 Sxnan

Thanks @Sxnan. I added it for my list for tomorrow. I'm sure it can still make it before the feature freeze.

twalthr avatar Jun 18 '25 13:06 twalthr

Hi @twalthr, could you take another look at your earliest convenience, in case we need to make some final adjustment to the PR before the feature freeze tomorrow.

Sxnan avatar Jun 20 '25 06:06 Sxnan

Hi @twalthr, thanks for the review! I updated the PR accordingly in the last two fixup commits. Please take another look.

Sxnan avatar Jun 20 '25 12:06 Sxnan

Fixup commits are squashed. Will merge after the test passes.

Sxnan avatar Jun 20 '25 12:06 Sxnan

@gustavodemorais Yes, it will be covered later in another PR.

Sxnan avatar Jun 20 '25 16:06 Sxnan