Skip to content

[OSSIE][DATABRICKS] Add Java Converter and Reformat - #333

Open
Haoranli503 wants to merge 4 commits into
apache:mainfrom
Haoranli503:databricks-converter-v2
Open

[OSSIE][DATABRICKS] Add Java Converter and Reformat#333
Haoranli503 wants to merge 4 commits into
apache:mainfrom
Haoranli503:databricks-converter-v2

Conversation

@Haoranli503

Copy link
Copy Markdown
Contributor

Summary

Adds a Java implementation of the Databricks converter alongside the existing Python
reference, and restructures converters/databricks/ to host both languages. The Java library is
the implementation maintained going forward; the Python converter becomes a reference copy slated
for deprecation.

Conversion is unchanged in spirit: pure YAML text in, YAML text out, reading and writing the two
formats as parsed maps and lists. The Java and Python implementations target the same Databricks
Unity Catalog Metric View YAML v1.1 contract, and the checked-in fixtures pin the expected output
for both directions (export: Ossie -> Metric View, import: Metric View -> Ossie).

Changes:

  • Restructure — the existing flat Python converter (src/, tests/, pyproject.toml,
    README.md, uv.lock) moves under converters/databricks/python/ with no content changes,
    making room for the Java tree.
  • Add java/ — the bidirectional converter as a Maven module: library, an
    OssieDatabricksConverter command-line tool, JUnit 5 tests, and YAML fixtures. Package
    org.apache.ossie.converter.databricks, following the conventions of the existing polaris and
    salesforce Java converters (parent org.apache:apache:39; deps SnakeYAML / Jackson / JUnit 5;
    apache-rat-plugin license audit; shade plugin for the executable CLI jar).
  • Add a root README.md describing the two-language layout and pointing at each
    implementation's own README.
  • CI (.github/workflows/converter-databricks-ci.yml) — point the Python job at the new
    python/ working directory, and add a Java job (mvn -B verify, Temurin JDK 21) mirroring
    converter-polaris-ci.yml.

Related Issues

Checklist

Specification

  • Spec changes are included in core-spec/ and follow the existing structure
  • Spec changes have been discussed on the mailing list or in a linked issue
  • Breaking changes to the spec are clearly called out in the summary

Ontology

  • Ontology changes in ontology/ are consistent with spec changes
  • New or modified terms are defined and documented

Converters

  • Converter logic in converters/ is updated to reflect spec or ontology changes
  • New converters include tests under the converter's test directory

Validation

  • Validation rules in validation/ are updated if the spec changed
  • New validation cases are covered by tests

Documentation

  • docs/ is updated to reflect any user-facing changes
  • New features or behaviors are documented with examples where appropriate
  • CONTRIBUTING.md is updated if the contribution process changed

Examples

  • examples/ are added or updated for any new spec constructs or converter support

Tests

  • All existing tests pass (pytest / CI green)
  • New functionality is covered by tests

Compliance

  • ASF license headers are present on all new source files
  • No third-party dependencies are added without PMC/IPMC approval

@jbonofre
jbonofre self-requested a review August 27, 2026 11:51
Haoranli503 and others added 3 commits August 28, 2026 06:52
Move the Python converter under converters/databricks/python/ (content unchanged) and add a Maven Java module -- library, CLI (OssieDatabricksConverter), JUnit tests, and fixtures under java/, package org.apache.ossie.converter.databricks -- as the maintained implementation. Add a root README describing the two-language layout, and a Java build job (mvn -B verify, JDK 21) in converter-databricks-ci.yml, mirroring the polaris converter.

Signed-off-by: Haoran Li <haoran.li@databricks.com>
Replace the Python README's forward-looking 'Future effort' section with a deprecation note: the Java converter under java/ is the maintained implementation; the Python copy is kept for reference and no longer actively extended.

Signed-off-by: Haoran Li <haoran.li@databricks.com>
Build:
- maven-shade no longer writes dependency-reduced-pom.xml into the module
  root, where apache-rat failed `mvn verify` on it as an unapproved file
- configure surefire to include **/*Suite.java: the default includes match
  none of the test classes, so the build ran zero tests and still passed
- drop the **/*.md rat exclude and restore the ASF header on both READMEs
- align snakeyaml with the 2.3 that jackson-dataformat-yaml declares

Converter:
- qualifyMeasure matches the whole qualifier run and resolves it from the
  leaf, so an expression that already carries a join path is no longer
  qualified a second time (SUM(customer.customer.region.population))
- de-alias measure qualifiers on import, the inverse of the export rewrite
  and what resolveColumn already did for dimensions
- match dropped names outside string literals when cascading drops, so a
  name that only occurs in a literal no longer drops an unrelated column
- quoteReplacement the stash unicode-escape pass, which halved an escaped
  backslash run instead of re-emitting it verbatim
- notice the ai_context object members and the foreign-vendor extensions
  dropped from a field or a metric
- validate a join source on import with the rule the export applies, so a
  view that imports cleanly is always exportable again

CLI:
- name the directions from the Apache Ossie model's point of view, matching
  the library Javadoc and the Python CLI: export = Ossie -> Metric View
- give each command its own selector flag instead of sharing one field, and
  resolve the command before parsing arguments so --help prints usage
- print to stdout without the extra newline, so stdout and -o agree

Tests:
- generate join-qualified and nested-path measures, and one_to_many
  branches, in the property round-trip suites
- add a regression test per fix, plus a CLI suite (the CLI had none)
@jbonofre
jbonofre force-pushed the databricks-converter-v2 branch from 366cccf to 5572106 Compare August 28, 2026 05:09
@jbonofre

Copy link
Copy Markdown
Member

@Haoranli503 I pushed some fixes here. Can you please take a look?

Signed-off-by: Haoran Li <haoran.li@databricks.com>
@Haoranli503

Copy link
Copy Markdown
Contributor Author

Hi @jbonofre , fixes look good. Thanks! I also pushed one commit addressing some issues we found when we are building native sql support based on the converter. Hope you can review those as well. Also feel free to change.

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.

2 participants