Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@
<argument>io.github.dfa1.vortex.fbsgen.Main</argument>
<argument>--out</argument>
<argument>${project.basedir}/src/main/java/io/github/dfa1/vortex/fbs</argument>
<argument>${project.basedir}/src/main/flatbuffers/vortex-array/array.fbs</argument>
<argument>${project.basedir}/src/main/flatbuffers/vortex-dtype/dtype.fbs</argument>
<argument>${project.basedir}/src/main/flatbuffers/vortex-file/footer.fbs</argument>
<argument>${project.basedir}/src/main/flatbuffers/vortex-layout/layout.fbs</argument>
<argument>${project.basedir}/src/main/fbs/array.fbs</argument>
<argument>${project.basedir}/src/main/fbs/dtype.fbs</argument>
<argument>${project.basedir}/src/main/fbs/footer.fbs</argument>
<argument>${project.basedir}/src/main/fbs/layout.fbs</argument>
</arguments>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors

include "vortex-array/array.fbs";
include "vortex-layout/layout.fbs";
include "array.fbs";
include "layout.fbs";

namespace io.github.dfa1.vortex.fbs;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ void emitsEnumConstantsOverUnderlyingType() throws IOException {
private static void generate(Path out) throws IOException {
Path root = repoRoot();
List<Ast.SchemaFile> files = List.of(
parse(root.resolve("core/src/main/flatbuffers/vortex-array/array.fbs")),
parse(root.resolve("core/src/main/flatbuffers/vortex-dtype/dtype.fbs")),
parse(root.resolve("core/src/main/flatbuffers/vortex-file/footer.fbs")),
parse(root.resolve("core/src/main/flatbuffers/vortex-layout/layout.fbs"))
parse(root.resolve("core/src/main/fbs/array.fbs")),
parse(root.resolve("core/src/main/fbs/dtype.fbs")),
parse(root.resolve("core/src/main/fbs/footer.fbs")),
parse(root.resolve("core/src/main/fbs/layout.fbs"))
);
new CodeGen(new TypeRegistry(files)).emit(out);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class VortexSchemas {
/// not a synthetic subset.
@ParameterizedTest
@ValueSource(strings = {
"core/src/main/flatbuffers/vortex-array/array.fbs",
"core/src/main/flatbuffers/vortex-dtype/dtype.fbs",
"core/src/main/flatbuffers/vortex-file/footer.fbs",
"core/src/main/flatbuffers/vortex-layout/layout.fbs"
"core/src/main/fbs/array.fbs",
"core/src/main/fbs/dtype.fbs",
"core/src/main/fbs/footer.fbs",
"core/src/main/fbs/layout.fbs"
})
void parsesEveryVortexSchema(String relPath) throws IOException {
// Given
Expand All @@ -39,7 +39,7 @@ void parsesEveryVortexSchema(String relPath) throws IOException {
void parsesDtypeUnionAndTable() throws IOException {
// Given — dtype.fbs is the richest: enum-with-underlying, a 12-member union,
// and tables that reference each other recursively.
Ast.SchemaFile sut = parse(repoRoot().resolve("core/src/main/flatbuffers/vortex-dtype/dtype.fbs"));
Ast.SchemaFile sut = parse(repoRoot().resolve("core/src/main/fbs/dtype.fbs"));

// Then — the underlying-typed enum is captured with all 11 PType values.
Ast.EnumDecl ptype = (Ast.EnumDecl) declNamed(sut, "PType");
Expand All @@ -62,7 +62,7 @@ void parsesDtypeUnionAndTable() throws IOException {
void parsesArrayStructVectorAndDefaults() throws IOException {
// Given — array.fbs exercises a struct (inline), vectors, an enum field,
// and `bool = null` three-state defaults.
Ast.SchemaFile sut = parse(repoRoot().resolve("core/src/main/flatbuffers/vortex-array/array.fbs"));
Ast.SchemaFile sut = parse(repoRoot().resolve("core/src/main/fbs/array.fbs"));

// Then — Buffer is a struct, and its compression field references the enum.
Ast.StructDecl buffer = (Ast.StructDecl) declNamed(sut, "Buffer");
Expand All @@ -82,10 +82,10 @@ void parsesArrayStructVectorAndDefaults() throws IOException {
@Test
void capturesIncludesAndRootTypes() throws IOException {
// Given — footer.fbs includes the other schemas and declares three root types.
Ast.SchemaFile sut = parse(repoRoot().resolve("core/src/main/flatbuffers/vortex-file/footer.fbs"));
Ast.SchemaFile sut = parse(repoRoot().resolve("core/src/main/fbs/footer.fbs"));

// Then
assertThat(sut.includes()).containsExactly("vortex-array/array.fbs", "vortex-layout/layout.fbs");
assertThat(sut.includes()).containsExactly("array.fbs", "layout.fbs");
assertThat(sut.rootTypes()).containsExactly("FileStatistics", "Footer", "Postscript");
}
}
Expand Down
Loading