Skip to content

feat(init): add FLINK preset with Flink-flavored function registration#54

Open
ggjh-159 wants to merge 1 commit into
bigo-sg:gluten-0530from
ggjh-159:feat/flink-preset
Open

feat(init): add FLINK preset with Flink-flavored function registration#54
ggjh-159 wants to merge 1 commit into
bigo-sg:gluten-0530from
ggjh-159:feat/flink-preset

Conversation

@ggjh-159

@ggjh-159 ggjh-159 commented Jul 6, 2026

Copy link
Copy Markdown

related issue: #51

Description

Adds a FLINK preset so Flink applications get Flink-flavored function registrations instead of inheriting Spark semantics.

What's in this PR

  • Config.henum Preset { SPARK = 0, FLINK = 1 }.
  • Config.cc — custom presetToStr/presetFromString (the default folly::tryTo<Preset> rejects the enum and fails at runtime with "Value 'FLINK' cannot be converted to type velox4j::Preset").
  • Init.cc:
    • Extracts registerConnectors() out of initForSpark() — the 9 connector serde/registration blocks (fuzzer / hive / kafka / pulsar / filesystem / external-stream / nexmark / print / from-elements) now live in their own function.
    • Removes the regexp_extract override inside initForSpark() (reverting PR Fix REGEXP_EXTRACT to return NULL instead of empty string on no match #31's global override).
    • Adds initForFlink() that calls initForSpark() + functions::flinksql::registerFunctions(). The reuse is intentional: velox/functions/flinksql/ does not yet ship a full scalar/aggregate/window function set, so Flink still rides on sparksql as the baseline; the flinksql entry only overrides dialect-specific semantics(feat: Add Flink-flavored REGEXP_EXTRACT in functions/flinksql velox#68).
    • Switch dispatches on the configured preset.
  • Preset.javaKEY, SPARK, FLINK constants for Velox4j.configure(...).

Testing

mvn test -Dtest=RegexpExtractTest — 3/3 PASS under the FLINK preset (no-match returns NULL).

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.

1 participant