quickhouse 0.3.4__tar.gz → 0.3.5__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.
Files changed (34) hide show
  1. {quickhouse-0.3.4 → quickhouse-0.3.5}/Cargo.lock +6 -6
  2. {quickhouse-0.3.4 → quickhouse-0.3.5}/Cargo.toml +1 -1
  3. {quickhouse-0.3.4 → quickhouse-0.3.5}/PKG-INFO +1 -1
  4. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/decode_mysql.rs +62 -2
  5. {quickhouse-0.3.4 → quickhouse-0.3.5}/pyproject.toml +1 -1
  6. {quickhouse-0.3.4 → quickhouse-0.3.5}/LICENSE +0 -0
  7. {quickhouse-0.3.4 → quickhouse-0.3.5}/README.md +0 -0
  8. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/Cargo.toml +0 -0
  9. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/archive.rs +0 -0
  10. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/config.rs +0 -0
  11. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/ddl.rs +0 -0
  12. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/decimal.rs +0 -0
  13. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/decode.rs +0 -0
  14. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/decode_bigquery.rs +0 -0
  15. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/error.rs +0 -0
  16. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/lib.rs +0 -0
  17. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/memory.rs +0 -0
  18. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/sink/bigquery.rs +0 -0
  19. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/sink/bigquery_proto.rs +0 -0
  20. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/sink/clickhouse.rs +0 -0
  21. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/sink/mod.rs +0 -0
  22. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/source/bigquery.rs +0 -0
  23. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/source/mod.rs +0 -0
  24. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/source/mysql.rs +0 -0
  25. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/source/postgres.rs +0 -0
  26. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/sync.rs +0 -0
  27. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/transform.rs +0 -0
  28. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-core/src/types.rs +0 -0
  29. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-py/Cargo.toml +0 -0
  30. {quickhouse-0.3.4 → quickhouse-0.3.5}/crates/quickhouse-py/src/lib.rs +0 -0
  31. {quickhouse-0.3.4 → quickhouse-0.3.5}/python/quickhouse/__init__.py +0 -0
  32. {quickhouse-0.3.4 → quickhouse-0.3.5}/python/quickhouse/_quickhouse.pyi +0 -0
  33. {quickhouse-0.3.4 → quickhouse-0.3.5}/python/quickhouse/progress.py +0 -0
  34. {quickhouse-0.3.4 → quickhouse-0.3.5}/python/quickhouse/py.typed +0 -0
@@ -555,9 +555,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
555
555
 
556
556
  [[package]]
557
557
  name = "cc"
558
- version = "1.3.0"
558
+ version = "1.4.0"
559
559
  source = "registry+https://github.com/rust-lang/crates.io-index"
560
- checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8"
560
+ checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9"
561
561
  dependencies = [
562
562
  "find-msvc-tools",
563
563
  "jobserver",
@@ -949,9 +949,9 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
949
949
 
950
950
  [[package]]
951
951
  name = "either"
952
- version = "1.16.0"
952
+ version = "1.17.0"
953
953
  source = "registry+https://github.com/rust-lang/crates.io-index"
954
- checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e"
954
+ checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d"
955
955
 
956
956
  [[package]]
957
957
  name = "encoding_rs"
@@ -2634,7 +2634,7 @@ dependencies = [
2634
2634
 
2635
2635
  [[package]]
2636
2636
  name = "quickhouse-core"
2637
- version = "0.3.4"
2637
+ version = "0.3.5"
2638
2638
  dependencies = [
2639
2639
  "anyhow",
2640
2640
  "arrow",
@@ -2670,7 +2670,7 @@ dependencies = [
2670
2670
 
2671
2671
  [[package]]
2672
2672
  name = "quickhouse-py"
2673
- version = "0.3.4"
2673
+ version = "0.3.5"
2674
2674
  dependencies = [
2675
2675
  "pyo3",
2676
2676
  "quickhouse-core",
@@ -3,7 +3,7 @@ resolver = "2"
3
3
  members = ["crates/quickhouse-core", "crates/quickhouse-py"]
4
4
 
5
5
  [workspace.package]
6
- version = "0.3.4"
6
+ version = "0.3.5"
7
7
  edition = "2021"
8
8
  license = "MIT"
9
9
  authors = ["quickhouse contributors"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quickhouse
3
- Version: 0.3.4
3
+ Version: 0.3.5
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -59,8 +59,16 @@ impl ColBuilder {
59
59
  DataType::Utf8 => ColBuilder::Str(StringBuilder::new()),
60
60
  DataType::Binary => ColBuilder::Bin(BinaryBuilder::new()),
61
61
  DataType::Date32 => ColBuilder::Date(Date32Builder::new()),
62
- DataType::Timestamp(TimeUnit::Microsecond, _) => {
63
- ColBuilder::Ts(TimestampMicrosecondBuilder::new())
62
+ // Carry the resolved timezone onto the builder so `finish()`
63
+ // produces an array whose type matches the batch schema exactly.
64
+ // MySQL datetimes now resolve to `Timestamp(µs, Some("UTC"))` (see
65
+ // types::map_mysql_type); dropping the tz here (as this used to)
66
+ // built a naive array that failed the batch-vs-schema check with
67
+ // "expected Timestamp(.., Some(\"UTC\")) but found Timestamp(..,
68
+ // None)". The stored micros are unaffected — this only sets the
69
+ // array's tz metadata. Mirrors the Postgres decoder (decode.rs).
70
+ DataType::Timestamp(TimeUnit::Microsecond, tz) => {
71
+ ColBuilder::Ts(TimestampMicrosecondBuilder::new().with_timezone_opt(tz.clone()))
64
72
  }
65
73
  DataType::Decimal128(p, s) => ColBuilder::Decimal128(
66
74
  Decimal128Builder::new().with_precision_and_scale(*p, *s)?,
@@ -446,6 +454,58 @@ mod tests {
446
454
  assert!(arr.is_null(2));
447
455
  }
448
456
 
457
+ /// End-to-end reproduction of the reported v0.3.4 failure, hermetic (no
458
+ /// live MySQL needed). The crash was a batch-vs-schema mismatch in
459
+ /// `RecordBatch::try_new` inside `flush_batch`; this rebuilds that exact
460
+ /// step — the schema field from the resolved Arrow type (as
461
+ /// `MySqlBatcher::with_batch_bytes` does via `Field::new(c.arrow, ...)`)
462
+ /// and the column array from `ColBuilder::finish()` — for a UTC-mapped
463
+ /// MySQL timestamp column. Before the decoder fix, `try_new` returned
464
+ /// "column types must match schema types, expected Timestamp(..,
465
+ /// Some(\"UTC\")) but found Timestamp(.., None)"; now the batch builds and
466
+ /// the column keeps its UTC type.
467
+ #[test]
468
+ fn utc_timestamp_column_builds_a_valid_batch() {
469
+ let arrow = DataType::Timestamp(TimeUnit::Microsecond, Some("UTC".into()));
470
+ let schema = Arc::new(Schema::new(vec![Field::new("created_date", arrow.clone(), true)]));
471
+ let mut b = ColBuilder::new(&arrow).unwrap();
472
+ b.append_value(Value::Date(2024, 5, 1, 10, 0, 0, 0)).unwrap();
473
+ let batch = RecordBatch::try_new(schema, vec![b.finish()])
474
+ .expect("v0.3.4 failed here: naive array vs UTC schema");
475
+ assert_eq!(batch.column(0).data_type(), &arrow);
476
+ assert_eq!(batch.num_rows(), 1);
477
+ }
478
+
479
+ /// Regression test for the 0.3.4 follow-up bug: the finished array's *type*
480
+ /// must carry the timezone from the resolved schema, not merely the correct
481
+ /// micros. MySQL datetimes resolve to `Timestamp(µs, Some("UTC"))`; a naive
482
+ /// array (tz `None`) built here failed the downstream batch-vs-schema check
483
+ /// with "expected Timestamp(.., Some(\"UTC\")) but found Timestamp(.., None)".
484
+ /// The earlier 0.3.4 tests asserted the mapping and the value, but not this
485
+ /// — the exact gap that let the regression ship.
486
+ #[test]
487
+ fn ts_builder_output_type_carries_timezone() {
488
+ // UTC-aware (the MySQL datetime default): finished array is tz-aware.
489
+ let mut utc =
490
+ ColBuilder::new(&DataType::Timestamp(TimeUnit::Microsecond, Some("UTC".into()))).unwrap();
491
+ utc.append_value(Value::Date(2024, 5, 1, 10, 0, 0, 0)).unwrap();
492
+ assert_eq!(
493
+ utc.finish().data_type(),
494
+ &DataType::Timestamp(TimeUnit::Microsecond, Some("UTC".into())),
495
+ "MySQL datetime array must carry the UTC timezone to match the resolved schema"
496
+ );
497
+ // Naive (the per-column `type_overrides={col: \"DATETIME\"}` opt-out)
498
+ // must still produce a naive array — the reverse mismatch.
499
+ let mut naive =
500
+ ColBuilder::new(&DataType::Timestamp(TimeUnit::Microsecond, None)).unwrap();
501
+ naive.append_value(Value::Date(2024, 5, 1, 10, 0, 0, 0)).unwrap();
502
+ assert_eq!(
503
+ naive.finish().data_type(),
504
+ &DataType::Timestamp(TimeUnit::Microsecond, None),
505
+ "a naive-mapped datetime column must stay naive"
506
+ );
507
+ }
508
+
449
509
  #[test]
450
510
  fn decimal_decodes_exact_text_value() {
451
511
  let mut b = ColBuilder::new(&DataType::Decimal128(10, 4)).unwrap();
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "quickhouse"
7
- version = "0.3.4"
7
+ version = "0.3.5"
8
8
  description = "Fast PostgreSQL/MySQL/BigQuery -> ClickHouse ETL with a Rust engine (parallel, bounded-memory, Arrow-based)."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
File without changes
File without changes