avrotize 3.0.1__tar.gz → 3.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {avrotize-3.0.1 → avrotize-3.0.2}/PKG-INFO +5 -3
- {avrotize-3.0.1 → avrotize-3.0.2}/README.md +4 -2
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/_version.py +3 -3
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotoiceberg.py +111 -13
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/commands.json +20 -2
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretodb.py +1 -1
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretoiceberg.py +113 -13
- {avrotize-3.0.1 → avrotize-3.0.2}/LICENSE +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/__init__.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/__main__.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/asn1toavro.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotize.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocpp/CMakeLists.txt.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocpp/build.bat.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocpp/build.sh.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocpp/dataclass_body.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocpp/vcpkg.json.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocpp.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocsharp/README.md.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocsharp/class_test.cs.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocsharp/dataclass_core.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocsharp/enum_test.cs.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocsharp/project.csproj.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocsharp/project.sln.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocsharp/run_coverage.ps1.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocsharp/run_coverage.sh.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocsharp/testproject.csproj.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocsharp.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotocsv.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotodatapackage.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotodb.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotogo/go_enum.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotogo/go_helpers.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotogo/go_struct.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotogo/go_test.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotogo/go_union.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotogo.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotographql.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotojava/class_test.java.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotojava/enum_test.java.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotojava/testproject.pom.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotojava.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotojs.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotojsons.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotojstruct.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotokusto.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotomd/README.md.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotomd.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotools.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotoparquet.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotoproto.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotopython/dataclass_core.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotopython/enum_core.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotopython/pyproject_toml.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotopython/test_class.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotopython/test_enum.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotopython.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotorust/dataclass_enum.rs.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotorust/dataclass_struct.rs.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotorust/dataclass_union.rs.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotorust.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotots/class_core.ts.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotots/class_test.ts.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotots/enum_core.ts.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotots/gitignore.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotots/index.ts.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotots/package.json.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotots/tsconfig.json.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotots.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/avrotoxsd.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/cddltostructure.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/common.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/constants.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/csvtoavro.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/datapackagetoavro.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/dependencies/cpp/vcpkg/vcpkg.json +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/dependencies/cs/net90/dependencies.csproj +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/dependencies/go/go121/go.mod +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/dependencies/java/jdk21/pom.xml +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/dependencies/python/py312/requirements.txt +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/dependencies/rust/stable/Cargo.toml +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/dependencies/typescript/node22/package.json +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/dependency_resolver.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/dependency_version.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/generic/generic.avsc +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/jsonstoavro.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/jsonstostructure.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/jstructtoavro.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/kstructtoavro.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/kustotoavro.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/openapitostructure.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/parquettoavro.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/proto2parser.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/proto3parser.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/prototoavro.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/prototypes/any.avsc +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/prototypes/api.avsc +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/prototypes/duration.avsc +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/prototypes/field_mask.avsc +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/prototypes/struct.avsc +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/prototypes/timestamp.avsc +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/prototypes/type.avsc +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/prototypes/wrappers.avsc +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocddl.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocpp/CMakeLists.txt.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocpp/build.bat.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocpp/build.sh.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocpp/dataclass_body.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocpp/vcpkg.json.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocpp.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocsharp/class_test.cs.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocsharp/dataclass_core.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocsharp/enum_test.cs.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocsharp/json_structure_converters.cs.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocsharp/program.cs.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocsharp/project.csproj.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocsharp/project.sln.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocsharp/testproject.csproj.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocsharp/tuple_converter.cs.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocsharp.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocsv.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretodatapackage.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretogo/go_enum.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretogo/go_helpers.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretogo/go_interface.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretogo/go_struct.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretogo/go_test.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretogo.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretographql.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretojava/choice_core.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretojava/class_core.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretojava/enum_core.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretojava/equals_hashcode.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretojava/pom.xml.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretojava/tuple_core.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretojava.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretojs/class_core.js.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretojs/enum_core.js.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretojs/package.json.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretojs/test_class.js.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretojs/test_enum.js.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretojs/test_runner.js.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretojs.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretojsons.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretokusto.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretomd/README.md.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretomd.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretoproto.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretopython/dataclass_core.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretopython/enum_core.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretopython/map_alias.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretopython/pyproject_toml.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretopython/test_class.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretopython/test_enum.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretopython.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretorust/dataclass_enum.rs.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretorust/dataclass_struct.rs.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretorust/dataclass_union.rs.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretorust.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretots/class_core.ts.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretots/enum_core.ts.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretots/gitignore.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretots/index.ts.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretots/package.json.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretots/test_class.ts.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretots/tsconfig.json.jinja +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretots.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretoxsd.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/avrotize/xsdtoavro.py +0 -0
- {avrotize-3.0.1 → avrotize-3.0.2}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: avrotize
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.2
|
|
4
4
|
Summary: Tools to convert from and to Avro Schema from various other schema languages.
|
|
5
5
|
Author-email: Clemens Vasters <clemensv@microsoft.com>
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -676,7 +676,7 @@ Conversion notes:
|
|
|
676
676
|
### Convert Avrotize Schema to Iceberg schema
|
|
677
677
|
|
|
678
678
|
```bash
|
|
679
|
-
avrotize a2ib <path_to_avro_schema_file> [--out <path_to_iceberg_schema_file>] [--record-type <record-type-from-avro>] [--emit-cloudevents-columns]
|
|
679
|
+
avrotize a2ib <path_to_avro_schema_file> [--out <path_to_iceberg_schema_file>] [--record-type <record-type-from-avro>] [--emit-cloudevents-columns] [--format schema|arrow]
|
|
680
680
|
```
|
|
681
681
|
|
|
682
682
|
Parameters:
|
|
@@ -685,6 +685,7 @@ Parameters:
|
|
|
685
685
|
- `--out`: The path to the Iceberg schema file to write the conversion result to. If omitted, the output is directed to stdout.
|
|
686
686
|
- `--record-type`: (optional) The name of the Avro record type to convert to an Iceberg schema.
|
|
687
687
|
- `--emit-cloudevents-columns`: (optional) If set, the tool will add [CloudEvents](https://cloudevents.io) attribute columns to the Iceberg schema: `__id`, `__source`, `__subject`, `__type`, and `__time`.
|
|
688
|
+
- `--format`: (optional) Output format. `schema` (default) outputs JSON per the [Iceberg Table Spec Appendix C](https://iceberg.apache.org/spec/#appendix-c-json-serialization). `arrow` outputs a binary Arrow IPC serialized schema.
|
|
688
689
|
|
|
689
690
|
Conversion notes:
|
|
690
691
|
|
|
@@ -695,7 +696,7 @@ Conversion notes:
|
|
|
695
696
|
### Convert JSON Structure to Iceberg schema
|
|
696
697
|
|
|
697
698
|
```bash
|
|
698
|
-
avrotize s2ib <path_to_structure_schema_file> [--out <path_to_iceberg_schema_file>] [--record-type <record-type-from-structure>] [--emit-cloudevents-columns]
|
|
699
|
+
avrotize s2ib <path_to_structure_schema_file> [--out <path_to_iceberg_schema_file>] [--record-type <record-type-from-structure>] [--emit-cloudevents-columns] [--format schema|arrow]
|
|
699
700
|
```
|
|
700
701
|
|
|
701
702
|
Parameters:
|
|
@@ -704,6 +705,7 @@ Parameters:
|
|
|
704
705
|
- `--out`: The path to the Iceberg schema file to write the conversion result to. If omitted, the output is directed to stdout.
|
|
705
706
|
- `--record-type`: (optional) The name of the record type in definitions to convert to an Iceberg schema.
|
|
706
707
|
- `--emit-cloudevents-columns`: (optional) If set, the tool will add [CloudEvents](https://cloudevents.io) attribute columns to the Iceberg schema: `___id`, `___source`, `___subject`, `___type`, and `___time`.
|
|
708
|
+
- `--format`: (optional) Output format. `schema` (default) outputs JSON per the [Iceberg Table Spec Appendix C](https://iceberg.apache.org/spec/#appendix-c-json-serialization). `arrow` outputs a binary Arrow IPC serialized schema.
|
|
707
709
|
|
|
708
710
|
Conversion notes:
|
|
709
711
|
|
|
@@ -628,7 +628,7 @@ Conversion notes:
|
|
|
628
628
|
### Convert Avrotize Schema to Iceberg schema
|
|
629
629
|
|
|
630
630
|
```bash
|
|
631
|
-
avrotize a2ib <path_to_avro_schema_file> [--out <path_to_iceberg_schema_file>] [--record-type <record-type-from-avro>] [--emit-cloudevents-columns]
|
|
631
|
+
avrotize a2ib <path_to_avro_schema_file> [--out <path_to_iceberg_schema_file>] [--record-type <record-type-from-avro>] [--emit-cloudevents-columns] [--format schema|arrow]
|
|
632
632
|
```
|
|
633
633
|
|
|
634
634
|
Parameters:
|
|
@@ -637,6 +637,7 @@ Parameters:
|
|
|
637
637
|
- `--out`: The path to the Iceberg schema file to write the conversion result to. If omitted, the output is directed to stdout.
|
|
638
638
|
- `--record-type`: (optional) The name of the Avro record type to convert to an Iceberg schema.
|
|
639
639
|
- `--emit-cloudevents-columns`: (optional) If set, the tool will add [CloudEvents](https://cloudevents.io) attribute columns to the Iceberg schema: `__id`, `__source`, `__subject`, `__type`, and `__time`.
|
|
640
|
+
- `--format`: (optional) Output format. `schema` (default) outputs JSON per the [Iceberg Table Spec Appendix C](https://iceberg.apache.org/spec/#appendix-c-json-serialization). `arrow` outputs a binary Arrow IPC serialized schema.
|
|
640
641
|
|
|
641
642
|
Conversion notes:
|
|
642
643
|
|
|
@@ -647,7 +648,7 @@ Conversion notes:
|
|
|
647
648
|
### Convert JSON Structure to Iceberg schema
|
|
648
649
|
|
|
649
650
|
```bash
|
|
650
|
-
avrotize s2ib <path_to_structure_schema_file> [--out <path_to_iceberg_schema_file>] [--record-type <record-type-from-structure>] [--emit-cloudevents-columns]
|
|
651
|
+
avrotize s2ib <path_to_structure_schema_file> [--out <path_to_iceberg_schema_file>] [--record-type <record-type-from-structure>] [--emit-cloudevents-columns] [--format schema|arrow]
|
|
651
652
|
```
|
|
652
653
|
|
|
653
654
|
Parameters:
|
|
@@ -656,6 +657,7 @@ Parameters:
|
|
|
656
657
|
- `--out`: The path to the Iceberg schema file to write the conversion result to. If omitted, the output is directed to stdout.
|
|
657
658
|
- `--record-type`: (optional) The name of the record type in definitions to convert to an Iceberg schema.
|
|
658
659
|
- `--emit-cloudevents-columns`: (optional) If set, the tool will add [CloudEvents](https://cloudevents.io) attribute columns to the Iceberg schema: `___id`, `___source`, `___subject`, `___type`, and `___time`.
|
|
660
|
+
- `--format`: (optional) Output format. `schema` (default) outputs JSON per the [Iceberg Table Spec Appendix C](https://iceberg.apache.org/spec/#appendix-c-json-serialization). `arrow` outputs a binary Arrow IPC serialized schema.
|
|
659
661
|
|
|
660
662
|
Conversion notes:
|
|
661
663
|
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '3.0.
|
|
32
|
-
__version_tuple__ = version_tuple = (3, 0,
|
|
31
|
+
__version__ = version = '3.0.2'
|
|
32
|
+
__version_tuple__ = version_tuple = (3, 0, 2)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g3ee5f8f67'
|
|
@@ -5,6 +5,7 @@ import sys
|
|
|
5
5
|
from typing import Dict, List
|
|
6
6
|
import pyarrow as pa
|
|
7
7
|
from pyiceberg.schema import Schema, NestedField
|
|
8
|
+
from pyiceberg.io.pyarrow import PyArrowFileIO, schema_to_pyarrow
|
|
8
9
|
from pyiceberg.types import (
|
|
9
10
|
BooleanType,
|
|
10
11
|
IntegerType,
|
|
@@ -21,11 +22,74 @@ from pyiceberg.types import (
|
|
|
21
22
|
MapType,
|
|
22
23
|
StructType
|
|
23
24
|
)
|
|
24
|
-
from pyiceberg.io.pyarrow import PyArrowFileIO, schema_to_pyarrow
|
|
25
25
|
|
|
26
26
|
JsonNode = Dict[str, 'JsonNode'] | List['JsonNode'] | str | bool | int | None
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
def iceberg_type_to_json(iceberg_type) -> str | Dict:
|
|
30
|
+
"""
|
|
31
|
+
Serialize an Iceberg type to JSON per Iceberg Table Spec Appendix C.
|
|
32
|
+
|
|
33
|
+
Primitive types are serialized as strings. Complex types (struct, list, map)
|
|
34
|
+
are serialized as JSON objects with their nested structure.
|
|
35
|
+
"""
|
|
36
|
+
# Primitive types map to simple strings
|
|
37
|
+
if isinstance(iceberg_type, BooleanType):
|
|
38
|
+
return "boolean"
|
|
39
|
+
elif isinstance(iceberg_type, IntegerType):
|
|
40
|
+
return "int"
|
|
41
|
+
elif isinstance(iceberg_type, LongType):
|
|
42
|
+
return "long"
|
|
43
|
+
elif isinstance(iceberg_type, FloatType):
|
|
44
|
+
return "float"
|
|
45
|
+
elif isinstance(iceberg_type, DoubleType):
|
|
46
|
+
return "double"
|
|
47
|
+
elif isinstance(iceberg_type, StringType):
|
|
48
|
+
return "string"
|
|
49
|
+
elif isinstance(iceberg_type, BinaryType):
|
|
50
|
+
return "binary"
|
|
51
|
+
elif isinstance(iceberg_type, DateType):
|
|
52
|
+
return "date"
|
|
53
|
+
elif isinstance(iceberg_type, TimestampType):
|
|
54
|
+
return "timestamp"
|
|
55
|
+
elif isinstance(iceberg_type, DecimalType):
|
|
56
|
+
return f"decimal({iceberg_type.precision},{iceberg_type.scale})"
|
|
57
|
+
elif isinstance(iceberg_type, FixedType):
|
|
58
|
+
return f"fixed[{iceberg_type.length}]"
|
|
59
|
+
elif isinstance(iceberg_type, ListType):
|
|
60
|
+
return {
|
|
61
|
+
"type": "list",
|
|
62
|
+
"element-id": iceberg_type.element_id,
|
|
63
|
+
"element-required": iceberg_type.element_required,
|
|
64
|
+
"element": iceberg_type_to_json(iceberg_type.element_type)
|
|
65
|
+
}
|
|
66
|
+
elif isinstance(iceberg_type, MapType):
|
|
67
|
+
return {
|
|
68
|
+
"type": "map",
|
|
69
|
+
"key-id": iceberg_type.key_id,
|
|
70
|
+
"key": iceberg_type_to_json(iceberg_type.key_type),
|
|
71
|
+
"value-id": iceberg_type.value_id,
|
|
72
|
+
"value-required": iceberg_type.value_required,
|
|
73
|
+
"value": iceberg_type_to_json(iceberg_type.value_type)
|
|
74
|
+
}
|
|
75
|
+
elif isinstance(iceberg_type, StructType):
|
|
76
|
+
return {
|
|
77
|
+
"type": "struct",
|
|
78
|
+
"fields": [
|
|
79
|
+
{
|
|
80
|
+
"id": field.field_id,
|
|
81
|
+
"name": field.name,
|
|
82
|
+
"required": field.required,
|
|
83
|
+
"type": iceberg_type_to_json(field.field_type)
|
|
84
|
+
}
|
|
85
|
+
for field in iceberg_type.fields
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
else:
|
|
89
|
+
# Fallback for unknown types
|
|
90
|
+
return str(iceberg_type)
|
|
91
|
+
|
|
92
|
+
|
|
29
93
|
class AvroToIcebergConverter:
|
|
30
94
|
"""Class to convert Avro schema to Iceberg schema."""
|
|
31
95
|
|
|
@@ -42,8 +106,16 @@ class AvroToIcebergConverter:
|
|
|
42
106
|
"""Get the full name of a record type."""
|
|
43
107
|
return f"{namespace}.{name}" if namespace else name
|
|
44
108
|
|
|
45
|
-
def convert_avro_to_iceberg(self, avro_schema_path: str, avro_record_type: str, output_path: str, emit_cloudevents_columns: bool=False):
|
|
46
|
-
"""Convert an Avro schema to an Iceberg schema.
|
|
109
|
+
def convert_avro_to_iceberg(self, avro_schema_path: str, avro_record_type: str, output_path: str, emit_cloudevents_columns: bool=False, output_format: str="arrow"):
|
|
110
|
+
"""Convert an Avro schema to an Iceberg schema.
|
|
111
|
+
|
|
112
|
+
Args:
|
|
113
|
+
avro_schema_path: Path to the Avro schema file
|
|
114
|
+
avro_record_type: Record type to convert (or None for the root)
|
|
115
|
+
output_path: Path to write the Iceberg schema
|
|
116
|
+
emit_cloudevents_columns: Whether to add CloudEvents columns
|
|
117
|
+
output_format: Output format - 'arrow' for binary Arrow IPC (default), 'schema' for JSON
|
|
118
|
+
"""
|
|
47
119
|
schema_file = avro_schema_path
|
|
48
120
|
if not schema_file:
|
|
49
121
|
print("Please specify the avro schema file")
|
|
@@ -96,14 +168,32 @@ class AvroToIcebergConverter:
|
|
|
96
168
|
])
|
|
97
169
|
|
|
98
170
|
iceberg_schema = Schema(*iceberg_fields)
|
|
99
|
-
|
|
100
|
-
print(f"Iceberg schema created: {arrow_schema}")
|
|
171
|
+
print(f"Iceberg schema created: {iceberg_schema}")
|
|
101
172
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
173
|
+
if output_format == "arrow":
|
|
174
|
+
# Write as binary PyArrow schema
|
|
175
|
+
arrow_schema = schema_to_pyarrow(iceberg_schema)
|
|
176
|
+
file_io = PyArrowFileIO()
|
|
177
|
+
output_file = file_io.new_output("file://" + output_path)
|
|
178
|
+
with output_file.create(overwrite=True) as f:
|
|
179
|
+
pa.output_stream(f).write(arrow_schema.serialize().to_pybytes())
|
|
180
|
+
else:
|
|
181
|
+
# Write Iceberg schema as spec-compliant JSON (per Iceberg Table Spec Appendix C)
|
|
182
|
+
schema_json = {
|
|
183
|
+
"type": "struct",
|
|
184
|
+
"schema-id": 0,
|
|
185
|
+
"fields": [
|
|
186
|
+
{
|
|
187
|
+
"id": field.field_id,
|
|
188
|
+
"name": field.name,
|
|
189
|
+
"required": field.required,
|
|
190
|
+
"type": iceberg_type_to_json(field.field_type)
|
|
191
|
+
}
|
|
192
|
+
for field in iceberg_schema.fields
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
with open(output_path, "w", encoding="utf-8") as f:
|
|
196
|
+
json.dump(schema_json, f, indent=2)
|
|
107
197
|
|
|
108
198
|
def convert_avro_type_to_iceberg_type(self, avro_type):
|
|
109
199
|
"""Convert an Avro type to an Iceberg type."""
|
|
@@ -203,8 +293,16 @@ class AvroToIcebergConverter:
|
|
|
203
293
|
return StringType()
|
|
204
294
|
|
|
205
295
|
|
|
206
|
-
def convert_avro_to_iceberg(avro_schema_path, avro_record_type, output_path, emit_cloudevents_columns=False):
|
|
207
|
-
"""Convert an Avro schema to an Iceberg schema.
|
|
296
|
+
def convert_avro_to_iceberg(avro_schema_path, avro_record_type, output_path, emit_cloudevents_columns=False, output_format="arrow"):
|
|
297
|
+
"""Convert an Avro schema to an Iceberg schema.
|
|
298
|
+
|
|
299
|
+
Args:
|
|
300
|
+
avro_schema_path: Path to the Avro schema file
|
|
301
|
+
avro_record_type: Record type to convert (or None for the root)
|
|
302
|
+
output_path: Path to write the Iceberg schema
|
|
303
|
+
emit_cloudevents_columns: Whether to add CloudEvents columns
|
|
304
|
+
output_format: Output format - 'arrow' for binary Arrow IPC (default), 'schema' for JSON
|
|
305
|
+
"""
|
|
208
306
|
converter = AvroToIcebergConverter()
|
|
209
307
|
converter.convert_avro_to_iceberg(
|
|
210
|
-
avro_schema_path, avro_record_type, output_path, emit_cloudevents_columns)
|
|
308
|
+
avro_schema_path, avro_record_type, output_path, emit_cloudevents_columns, output_format)
|
|
@@ -1115,7 +1115,8 @@
|
|
|
1115
1115
|
"avro_schema_path": "input_file_path",
|
|
1116
1116
|
"output_path": "output_file_path",
|
|
1117
1117
|
"avro_record_type": "args.record_type",
|
|
1118
|
-
"emit_cloudevents_columns": "args.emit_cloudevents_columns"
|
|
1118
|
+
"emit_cloudevents_columns": "args.emit_cloudevents_columns",
|
|
1119
|
+
"output_format": "args.format"
|
|
1119
1120
|
}
|
|
1120
1121
|
},
|
|
1121
1122
|
"extensions": [
|
|
@@ -1147,6 +1148,14 @@
|
|
|
1147
1148
|
"help": "Add CloudEvents columns to the Iceberg schema",
|
|
1148
1149
|
"default": false,
|
|
1149
1150
|
"required": false
|
|
1151
|
+
},
|
|
1152
|
+
{
|
|
1153
|
+
"name": "--format",
|
|
1154
|
+
"type": "str",
|
|
1155
|
+
"help": "Output format: 'arrow' for binary Arrow IPC (default), 'schema' for JSON",
|
|
1156
|
+
"choices": ["schema", "arrow"],
|
|
1157
|
+
"default": "arrow",
|
|
1158
|
+
"required": false
|
|
1150
1159
|
}
|
|
1151
1160
|
],
|
|
1152
1161
|
"suggested_output_file_path": "{input_file_name}.iceberg",
|
|
@@ -1169,7 +1178,8 @@
|
|
|
1169
1178
|
"structure_schema_path": "input_file_path",
|
|
1170
1179
|
"output_path": "output_file_path",
|
|
1171
1180
|
"structure_record_type": "args.record_type",
|
|
1172
|
-
"emit_cloudevents_columns": "args.emit_cloudevents_columns"
|
|
1181
|
+
"emit_cloudevents_columns": "args.emit_cloudevents_columns",
|
|
1182
|
+
"output_format": "args.format"
|
|
1173
1183
|
}
|
|
1174
1184
|
},
|
|
1175
1185
|
"extensions": [
|
|
@@ -1202,6 +1212,14 @@
|
|
|
1202
1212
|
"help": "Add CloudEvents columns to the Iceberg schema",
|
|
1203
1213
|
"default": false,
|
|
1204
1214
|
"required": false
|
|
1215
|
+
},
|
|
1216
|
+
{
|
|
1217
|
+
"name": "--format",
|
|
1218
|
+
"type": "str",
|
|
1219
|
+
"help": "Output format: 'arrow' for binary Arrow IPC (default), 'schema' for JSON",
|
|
1220
|
+
"choices": ["schema", "arrow"],
|
|
1221
|
+
"default": "arrow",
|
|
1222
|
+
"required": false
|
|
1205
1223
|
}
|
|
1206
1224
|
],
|
|
1207
1225
|
"suggested_output_file_path": "{input_file_name}.iceberg",
|
|
@@ -426,7 +426,7 @@ def structure_type_to_sql_type(structure_type: Any, dialect: str) -> str:
|
|
|
426
426
|
type_map["sqlanywhere"] = type_map["sqlserver"].copy()
|
|
427
427
|
type_map["bigquery"] = {k: v.replace("VARCHAR", "STRING").replace("JSONB", "STRING").replace("BYTEA", "BYTES") for k, v in type_map["postgres"].items()}
|
|
428
428
|
type_map["snowflake"] = {k: v.replace("JSONB", "VARIANT").replace("BYTEA", "BINARY") for k, v in type_map["postgres"].items()}
|
|
429
|
-
type_map["redshift"] = type_map["postgres"].
|
|
429
|
+
type_map["redshift"] = {k: v.replace("JSONB", "SUPER").replace("BYTEA", "VARBYTE") for k, v in type_map["postgres"].items()}
|
|
430
430
|
|
|
431
431
|
# Handle type resolution
|
|
432
432
|
if isinstance(structure_type, str):
|
|
@@ -5,6 +5,7 @@ import sys
|
|
|
5
5
|
from typing import Dict, List, Any, Optional
|
|
6
6
|
import pyarrow as pa
|
|
7
7
|
from pyiceberg.schema import Schema, NestedField
|
|
8
|
+
from pyiceberg.io.pyarrow import PyArrowFileIO, schema_to_pyarrow
|
|
8
9
|
from pyiceberg.types import (
|
|
9
10
|
BooleanType,
|
|
10
11
|
IntegerType,
|
|
@@ -22,11 +23,76 @@ from pyiceberg.types import (
|
|
|
22
23
|
StructType,
|
|
23
24
|
TimeType
|
|
24
25
|
)
|
|
25
|
-
from pyiceberg.io.pyarrow import PyArrowFileIO, schema_to_pyarrow
|
|
26
26
|
|
|
27
27
|
JsonNode = Dict[str, 'JsonNode'] | List['JsonNode'] | str | bool | int | None
|
|
28
28
|
|
|
29
29
|
|
|
30
|
+
def iceberg_type_to_json(iceberg_type) -> str | Dict:
|
|
31
|
+
"""
|
|
32
|
+
Serialize an Iceberg type to JSON per Iceberg Table Spec Appendix C.
|
|
33
|
+
|
|
34
|
+
Primitive types are serialized as strings. Complex types (struct, list, map)
|
|
35
|
+
are serialized as JSON objects with their nested structure.
|
|
36
|
+
"""
|
|
37
|
+
# Primitive types map to simple strings
|
|
38
|
+
if isinstance(iceberg_type, BooleanType):
|
|
39
|
+
return "boolean"
|
|
40
|
+
elif isinstance(iceberg_type, IntegerType):
|
|
41
|
+
return "int"
|
|
42
|
+
elif isinstance(iceberg_type, LongType):
|
|
43
|
+
return "long"
|
|
44
|
+
elif isinstance(iceberg_type, FloatType):
|
|
45
|
+
return "float"
|
|
46
|
+
elif isinstance(iceberg_type, DoubleType):
|
|
47
|
+
return "double"
|
|
48
|
+
elif isinstance(iceberg_type, StringType):
|
|
49
|
+
return "string"
|
|
50
|
+
elif isinstance(iceberg_type, BinaryType):
|
|
51
|
+
return "binary"
|
|
52
|
+
elif isinstance(iceberg_type, DateType):
|
|
53
|
+
return "date"
|
|
54
|
+
elif isinstance(iceberg_type, TimeType):
|
|
55
|
+
return "time"
|
|
56
|
+
elif isinstance(iceberg_type, TimestampType):
|
|
57
|
+
return "timestamp"
|
|
58
|
+
elif isinstance(iceberg_type, DecimalType):
|
|
59
|
+
return f"decimal({iceberg_type.precision},{iceberg_type.scale})"
|
|
60
|
+
elif isinstance(iceberg_type, FixedType):
|
|
61
|
+
return f"fixed[{iceberg_type.length}]"
|
|
62
|
+
elif isinstance(iceberg_type, ListType):
|
|
63
|
+
return {
|
|
64
|
+
"type": "list",
|
|
65
|
+
"element-id": iceberg_type.element_id,
|
|
66
|
+
"element-required": iceberg_type.element_required,
|
|
67
|
+
"element": iceberg_type_to_json(iceberg_type.element_type)
|
|
68
|
+
}
|
|
69
|
+
elif isinstance(iceberg_type, MapType):
|
|
70
|
+
return {
|
|
71
|
+
"type": "map",
|
|
72
|
+
"key-id": iceberg_type.key_id,
|
|
73
|
+
"key": iceberg_type_to_json(iceberg_type.key_type),
|
|
74
|
+
"value-id": iceberg_type.value_id,
|
|
75
|
+
"value-required": iceberg_type.value_required,
|
|
76
|
+
"value": iceberg_type_to_json(iceberg_type.value_type)
|
|
77
|
+
}
|
|
78
|
+
elif isinstance(iceberg_type, StructType):
|
|
79
|
+
return {
|
|
80
|
+
"type": "struct",
|
|
81
|
+
"fields": [
|
|
82
|
+
{
|
|
83
|
+
"id": field.field_id,
|
|
84
|
+
"name": field.name,
|
|
85
|
+
"required": field.required,
|
|
86
|
+
"type": iceberg_type_to_json(field.field_type)
|
|
87
|
+
}
|
|
88
|
+
for field in iceberg_type.fields
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
else:
|
|
92
|
+
# Fallback for unknown types
|
|
93
|
+
return str(iceberg_type)
|
|
94
|
+
|
|
95
|
+
|
|
30
96
|
class StructureToIcebergConverter:
|
|
31
97
|
"""Class to convert JSON Structure schema to Iceberg schema."""
|
|
32
98
|
|
|
@@ -45,8 +111,16 @@ class StructureToIcebergConverter:
|
|
|
45
111
|
"""Get the full name of a record type."""
|
|
46
112
|
return f"{namespace}.{name}" if namespace else name
|
|
47
113
|
|
|
48
|
-
def convert_structure_to_iceberg(self, structure_schema_path: str, structure_record_type: Optional[str], output_path: str, emit_cloudevents_columns: bool=False):
|
|
49
|
-
"""Convert a JSON Structure schema to an Iceberg schema.
|
|
114
|
+
def convert_structure_to_iceberg(self, structure_schema_path: str, structure_record_type: Optional[str], output_path: str, emit_cloudevents_columns: bool=False, output_format: str="arrow"):
|
|
115
|
+
"""Convert a JSON Structure schema to an Iceberg schema.
|
|
116
|
+
|
|
117
|
+
Args:
|
|
118
|
+
structure_schema_path: Path to the JSON Structure schema file
|
|
119
|
+
structure_record_type: Record type to convert (or None for the root)
|
|
120
|
+
output_path: Path to write the Iceberg schema
|
|
121
|
+
emit_cloudevents_columns: Whether to add CloudEvents columns
|
|
122
|
+
output_format: Output format - 'arrow' for binary Arrow IPC (default), 'schema' for JSON
|
|
123
|
+
"""
|
|
50
124
|
schema_file = structure_schema_path
|
|
51
125
|
if not schema_file:
|
|
52
126
|
print("Please specify the JSON Structure schema file")
|
|
@@ -114,14 +188,32 @@ class StructureToIcebergConverter:
|
|
|
114
188
|
])
|
|
115
189
|
|
|
116
190
|
iceberg_schema = Schema(*iceberg_fields)
|
|
117
|
-
|
|
118
|
-
print(f"Iceberg schema created: {arrow_schema}")
|
|
191
|
+
print(f"Iceberg schema created: {iceberg_schema}")
|
|
119
192
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
193
|
+
if output_format == "arrow":
|
|
194
|
+
# Write as binary PyArrow schema
|
|
195
|
+
arrow_schema = schema_to_pyarrow(iceberg_schema)
|
|
196
|
+
file_io = PyArrowFileIO()
|
|
197
|
+
output_file = file_io.new_output("file://" + output_path)
|
|
198
|
+
with output_file.create(overwrite=True) as f:
|
|
199
|
+
pa.output_stream(f).write(arrow_schema.serialize().to_pybytes())
|
|
200
|
+
else:
|
|
201
|
+
# Write Iceberg schema as spec-compliant JSON (per Iceberg Table Spec Appendix C)
|
|
202
|
+
schema_json = {
|
|
203
|
+
"type": "struct",
|
|
204
|
+
"schema-id": 0,
|
|
205
|
+
"fields": [
|
|
206
|
+
{
|
|
207
|
+
"id": field.field_id,
|
|
208
|
+
"name": field.name,
|
|
209
|
+
"required": field.required,
|
|
210
|
+
"type": iceberg_type_to_json(field.field_type)
|
|
211
|
+
}
|
|
212
|
+
for field in iceberg_schema.fields
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
with open(output_path, "w", encoding="utf-8") as f:
|
|
216
|
+
json.dump(schema_json, f, indent=2)
|
|
125
217
|
|
|
126
218
|
def resolve_ref(self, ref: str) -> Dict[str, Any]:
|
|
127
219
|
"""Resolve a $ref reference."""
|
|
@@ -348,8 +440,16 @@ class StructureToIcebergConverter:
|
|
|
348
440
|
return type_mapping.get(type_name, StringType())
|
|
349
441
|
|
|
350
442
|
|
|
351
|
-
def convert_structure_to_iceberg(structure_schema_path, structure_record_type, output_path, emit_cloudevents_columns=False):
|
|
352
|
-
"""Convert a JSON Structure schema to an Iceberg schema.
|
|
443
|
+
def convert_structure_to_iceberg(structure_schema_path, structure_record_type, output_path, emit_cloudevents_columns=False, output_format="arrow"):
|
|
444
|
+
"""Convert a JSON Structure schema to an Iceberg schema.
|
|
445
|
+
|
|
446
|
+
Args:
|
|
447
|
+
structure_schema_path: Path to the JSON Structure schema file
|
|
448
|
+
structure_record_type: Record type to convert (or None for the root)
|
|
449
|
+
output_path: Path to write the Iceberg schema
|
|
450
|
+
emit_cloudevents_columns: Whether to add CloudEvents columns
|
|
451
|
+
output_format: Output format - 'arrow' for binary Arrow IPC (default), 'schema' for JSON
|
|
452
|
+
"""
|
|
353
453
|
converter = StructureToIcebergConverter()
|
|
354
454
|
converter.convert_structure_to_iceberg(
|
|
355
|
-
structure_schema_path, structure_record_type, output_path, emit_cloudevents_columns)
|
|
455
|
+
structure_schema_path, structure_record_type, output_path, emit_cloudevents_columns, output_format)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{avrotize-3.0.1 → avrotize-3.0.2}/avrotize/structuretocsharp/json_structure_converters.cs.jinja
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|