Skip to content

Commit ef75f15

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into feat/direct-arrow-byte-arrays
Signed-off-by: 蔡略 <cailue@apache.org>
2 parents d8ce25a + 3048533 commit ef75f15

81 files changed

Lines changed: 4637 additions & 602 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/bench.yml‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -171,31 +171,3 @@ jobs:
171171
secrets: inherit
172172
with:
173173
mode: "develop"
174-
175-
sql-vortex:
176-
uses: ./.github/workflows/sql-benchmarks.yml
177-
secrets: inherit
178-
with:
179-
mode: "develop"
180-
benchmark_matrix: |
181-
[
182-
{
183-
"id": "vortex-queries",
184-
"subcommand": "vortex",
185-
"name": "Vortex queries",
186-
"data_formats": ["parquet", "vortex"],
187-
"pr_targets": [
188-
{"engine": "datafusion", "format": "parquet"},
189-
{"engine": "datafusion", "format": "vortex"},
190-
{"engine": "duckdb", "format": "parquet"},
191-
{"engine": "duckdb", "format": "vortex"}
192-
],
193-
"develop_targets": [
194-
{"engine": "datafusion", "format": "parquet"},
195-
{"engine": "datafusion", "format": "vortex"},
196-
{"engine": "duckdb", "format": "parquet"},
197-
{"engine": "duckdb", "format": "vortex"}
198-
],
199-
"iterations": "100"
200-
}
201-
]

‎.github/workflows/ci.yml‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,14 +558,25 @@ jobs:
558558
cargo +$NIGHTLY_TOOLCHAIN build --locked --no-default-features \
559559
--target x86_64-unknown-linux-gnu -Zbuild-std \
560560
-p vortex-ffi
561-
- name: Build C++ library (asan)
561+
- name: Build C++ tests and examples (asan)
562562
run: |
563563
mkdir -p build
564-
cmake -S lang/cpp -Bbuild -DSANITIZER=asan -DBUILD_TESTS=1 -DTARGET_TRIPLE="x86_64-unknown-linux-gnu"
564+
cmake -S lang/cpp -Bbuild -DSANITIZER=asan -DBUILD_TESTS=1 -DBUILD_EXAMPLES=1 -DTARGET_TRIPLE="x86_64-unknown-linux-gnu"
565565
cmake --build build --parallel $(nproc)
566566
- name: Run C++ tests
567567
run: |
568568
build/tests/vortex_cxx_test
569+
- name: Run C++ examples
570+
run: |
571+
cd build/examples
572+
./writer people0.vortex
573+
./writer people1.vortex
574+
./writer me.vortex
575+
576+
./scan '*.vortex'
577+
./dtype me.vortex
578+
579+
./reader
569580
570581
sqllogic-test:
571582
name: "SQL logic tests"

‎.github/workflows/rust-instrumented.yml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,6 @@ jobs:
279279
run: |
280280
set -o pipefail
281281
282-
# Failed to create data source: Object store error: Generic LocalFileSystem
283-
# error: Unable to walk dir: File system loop found
284-
rm -fr vortex-ffi/build/_deps/nanoarrow-src/python
285-
286282
./vortex-ffi/build/examples/write_sample file.vortex
287283
./vortex-ffi/build/examples/write_sample file2.vortex
288284
./vortex-ffi/build/examples/dtype '*.vortex'

‎.github/workflows/sql-benchmarks.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,25 @@ on:
298298
{"engine": "duckdb", "format": "duckdb"}
299299
],
300300
"iterations": "10"
301+
},
302+
{
303+
"id": "vortex-queries",
304+
"subcommand": "vortex",
305+
"name": "Vortex queries",
306+
"data_formats": ["parquet", "vortex"],
307+
"pr_targets": [
308+
{"engine": "datafusion", "format": "parquet"},
309+
{"engine": "datafusion", "format": "vortex"},
310+
{"engine": "duckdb", "format": "parquet"},
311+
{"engine": "duckdb", "format": "vortex"}
312+
],
313+
"develop_targets": [
314+
{"engine": "datafusion", "format": "parquet"},
315+
{"engine": "datafusion", "format": "vortex"},
316+
{"engine": "duckdb", "format": "parquet"},
317+
{"engine": "duckdb", "format": "vortex"}
318+
],
319+
"iterations": "100"
301320
}
302321
]
303322
base_benchmark_matrix:

‎.github/workflows/sql-vortex-pr.yml‎

Lines changed: 0 additions & 47 deletions
This file was deleted.

‎benchmarks/duckdb-bench/src/main.rs‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ use vortex_bench::runner::filter_queries;
2626
use vortex_bench::setup_logging_and_tracing;
2727
use vortex_bench::v3;
2828

29+
const S3_HTTP_INIT_SQL: [&str; 3] = [
30+
"SET http_retries = 8",
31+
"SET http_retry_wait_ms = 250",
32+
"SET http_retry_backoff = 2",
33+
];
34+
2935
/// Common arguments shared across benchmarks
3036
#[derive(Parser)]
3137
struct Args {
@@ -159,6 +165,11 @@ fn main() -> anyhow::Result<()> {
159165
)?;
160166

161167
let benchmark_name = benchmark.dataset().to_string();
168+
let mut duckdb_init_sql = Vec::new();
169+
if benchmark.data_url().scheme() == "s3" {
170+
duckdb_init_sql.extend(S3_HTTP_INIT_SQL.map(String::from));
171+
}
172+
duckdb_init_sql.extend(benchmark.engine_init_sql(Engine::DuckDB));
162173

163174
let mode = if args.explain {
164175
BenchmarkMode::Explain
@@ -178,7 +189,7 @@ fn main() -> anyhow::Result<()> {
178189
args.delete_duckdb_database,
179190
args.threads,
180191
)?;
181-
ctx.set_init_sql(benchmark.engine_init_sql(Engine::DuckDB))?;
192+
ctx.set_init_sql(duckdb_init_sql.clone())?;
182193
ctx.register_tables(&*benchmark, format)?;
183194

184195
// Duckdb doesn't support octet_length for strings but we need this

‎docs/specs/file-format.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ The postscript contains the locations of:
5454
2. a `layout` segment containing the root `Layout`
5555
3. a `statistics` segment containing file-level per-field statistics (e.g., minima and maxima of each field/column, for whole-file pruning)
5656
4. a `footer` segment containing a dictionary-encoded _segment map_, and other shared configuration such as compression and encryption schemes
57+
5. up to 16 user-defined `metadata` segments, each identified by a unique, non-empty UTF-8 key of at most 64 bytes
58+
59+
The postscript carries a locator (offset, length, and alignment) for each metadata segment that is
60+
present; a file written without user metadata (and any file predating this feature) carries none.
61+
Readers do not load the opaque metadata values by default. Opt-in metadata reads resolve each
62+
locator separately, allowing values outside the initial file-tail read to be fetched without reading
63+
the intervening file contents.
5764

5865
:::{literalinclude} ../../vortex-flatbuffers/flatbuffers/vortex-file/footer.fbs
5966
:start-after: [postscript]

‎encodings/decimal-byte-parts/src/decimal_byte_parts/compute/mod.rs‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ mod tests {
1616
use vortex_array::VortexSessionExecute;
1717
use vortex_array::array_session;
1818
use vortex_array::arrays::PrimitiveArray;
19+
use vortex_array::compute::conformance::binary_numeric::test_binary_numeric_array;
1920
use vortex_array::compute::conformance::consistency::test_array_consistency;
2021
use vortex_array::dtype::DecimalDType;
2122
use vortex_buffer::buffer;
@@ -74,4 +75,22 @@ mod tests {
7475
let ctx = &mut array_session().create_execution_ctx();
7576
test_array_consistency(&array.into_array(), ctx);
7677
}
78+
79+
#[rstest]
80+
#[case::decimal_i32(DecimalByteParts::try_new(
81+
buffer![100i32, 200, 300, 400, 500].into_array(),
82+
DecimalDType::new(10, 2)
83+
).unwrap())]
84+
#[case::decimal_nullable_i64(DecimalByteParts::try_new(
85+
PrimitiveArray::from_option_iter([Some(1000i64), None, Some(3000), Some(4000), None]).into_array(),
86+
DecimalDType::new(19, 4)
87+
).unwrap())]
88+
#[case::decimal_negative(DecimalByteParts::try_new(
89+
buffer![-100i32, -200, 300, -400, 500].into_array(),
90+
DecimalDType::new(10, 2)
91+
).unwrap())]
92+
fn test_decimal_byte_parts_binary_numeric(#[case] array: DecimalBytePartsArray) {
93+
let ctx = &mut array_session().create_execution_ctx();
94+
test_binary_numeric_array(&array.into_array(), ctx);
95+
}
7796
}

‎fuzz/src/array/fill_null.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ pub fn fill_null_canonical_array(
4949
| Canonical::List(_)
5050
| Canonical::FixedSizeList(_)
5151
| Canonical::Extension(_) => canonical.into_array().fill_null(fill_value.clone())?,
52+
Canonical::Union(_) => {
53+
todo!("TODO(connor)[Union]: support Union arrays in the fill_null fuzzer")
54+
}
5255
Canonical::Variant(_) => unreachable!("Variant arrays are not fuzzed"),
5356
})
5457
}

‎fuzz/src/array/mask.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ pub fn mask_canonical_array(
149149
.with_nullability(masked_storage.dtype().nullability());
150150
ExtensionArray::new(ext_dtype, masked_storage).into_array()
151151
}
152+
Canonical::Union(_) => {
153+
todo!("TODO(connor)[Union]: support Union arrays in the mask fuzzer")
154+
}
152155
Canonical::Variant(_) => unreachable!("Variant arrays are not fuzzed"),
153156
})
154157
}

0 commit comments

Comments
 (0)