Skip to content

[FLINK-39183][table] Support BITMAP type in Calcite parser#27720

Open
dylanhz wants to merge 1 commit intoapache:masterfrom
dylanhz:FLINK-39183
Open

[FLINK-39183][table] Support BITMAP type in Calcite parser#27720
dylanhz wants to merge 1 commit intoapache:masterfrom
dylanhz:FLINK-39183

Conversation

@dylanhz
Copy link
Contributor

@dylanhz dylanhz commented Mar 2, 2026

What is the purpose of the change

This pull request adds parsing support for the BITMAP data type in Flink's Calcite-based SQL parser.

Brief change log

  • Added BITMAP token and type literal to Parser.jj
  • Extended the forked SqlTypeName and SqlTypeFamily enums with BITMAP

Verifying this change

  • FlinkSqlParserImplTest#testBitmapType

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): no
  • 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? not documented (documentation will be added when the full BITMAP type support is complete)

@flinkbot
Copy link
Collaborator

flinkbot commented Mar 2, 2026

CI report:

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

Comment on lines +5811 to +7982
@@ -7977,6 +7979,7 @@ SqlPostfixOperator PostfixRowOperator() :
| < BIGINT: "BIGINT" >
| < BINARY: "BINARY" >
| < BIT: "BIT" >
| < BITMAP: "BITMAP" >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it in Calcite?
We shouldn't change this file without good justification
It should be removed once we bump to certain Calcite version

Copy link
Contributor

@snuyanzin snuyanzin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do this without Parser.jj modification?
Or first be sure it is merged to Calcite and then port changes here

@liuyongvs
Copy link
Contributor

Can we do this without Parser.jj modification? Or first be sure it is merged to Calcite and then port changes here

i also agree this "merged to Calcite and then port changes here"

@dylanhz
Copy link
Contributor Author

dylanhz commented Mar 3, 2026

Can we do this without Parser.jj modification? Or first be sure it is merged to Calcite and then port changes here

Thanks for the review!

BITMAP is not a SQL standard type — it's an extension type specific to analytical systems, so proposing it to Calcite upstream doesn't really make sense. This also shouldn't block Flink from introducing its own extension type.

For the Parser.jj concern, would it be acceptable if we move the token and type parsing rule into Parser.tdd and parserImpls.ftl? This follows the same pattern used by STRING, BYTES, RAW, etc. The SqlTypeName.java and SqlTypeFamily.java changes would remain as-is.

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.

4 participants