Skip to content

Commit

Permalink
Merge fixes from dev-ion-doc feature branch back to main (#497)
Browse files Browse the repository at this point in the history
* Rename `ion-rs` to `ion-rs_old` in preparation of upgrade (#492)

* Refactor lexer into module & upgrade lexer & parser dependencies (#493)

* Upgrade project deps to latest; use semver, not wildcard nor tilde (#494)
  • Loading branch information
jpschorr authored Sep 17, 2024
1 parent deff7a8 commit 70b5ea2
Show file tree
Hide file tree
Showing 35 changed files with 1,633 additions and 1,611 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
- name: Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2023-06-09
toolchain: nightly-2024-08-06
- uses: actions/cache@v3
id: restore-build
with:
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
- name: Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2023-06-09
toolchain: nightly-2024-08-06
- uses: actions/cache@v3
id: restore-build-and-conformance
with:
Expand Down
34 changes: 3 additions & 31 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
# More documentation for the advisories section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html
[advisories]
vulnerability = "deny"
unsound = "deny"
unmaintained = "deny"
yanked = "deny"
notice = "warn"
version = 2

ignore = [
# Advisory: https://rustsec.org/advisories/RUSTSEC-2021-0145
Expand All @@ -28,8 +24,7 @@ ignore = [
# More documentation for the licenses section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
[licenses]
# The lint level for crates which do not have a detectable license
unlicensed = "deny"
version = 2
# ignores workspace crates that aren't published, or are only published to private registries.
private = { ignore = true }

Expand Down Expand Up @@ -62,29 +57,6 @@ exceptions = [
{ allow = ["Unicode-DFS-2016"], name = "unicode-ident" },
]

# Lint level for licenses considered copyleft
copyleft = "deny"

# List of explicitly disallowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
deny = [
]

# Blanket approval or denial for OSI-approved or FSF Free/Libre licenses
# * both - The license will be approved if it is both OSI-approved *AND* FSF
# * either - The license will be approved if it is either OSI-approved *OR* FSF
# * osi-only - The license will be approved if is OSI-approved *AND NOT* FSF
# * fsf-only - The license will be approved if is FSF *AND NOT* OSI-approved
# * neither - This predicate is ignored and the default lint level is used
allow-osi-fsf-free = "neither"

# Lint level used when no other predicates are matched
# 1. License isn't in the allow or deny lists
# 2. License isn't copyleft
# 3. License isn't OSI/FSF, or allow-osi-fsf-free = "neither"
default = "deny"

# The confidence threshold for detecting a license from license text.
# The higher the value, the more closely the license text must be to the
# canonical license text of a valid SPDX license file.
Expand Down Expand Up @@ -125,7 +97,7 @@ allow = [
deny = [
# Use `once_cell` instead
# `OnceCell`s API is under consideration for inclusion in `std`: https://github.com/rust-lang/rust/issues/74465
{ name = "lazy_static", wrappers = ["Inflector", "criterion", "insta", "console"] },
{ name = "lazy_static", wrappers = ["Inflector", "criterion", "insta", "console", "logos-codegen"] },
# Advisory: https://rustsec.org/advisories/RUSTSEC-2020-0071
# `time` < 0.2.23 has a potential (though unlikely) potential segfault
{ name = "time", version = "<0.2.23", wrappers = ["chrono"] },
Expand Down
9 changes: 4 additions & 5 deletions extension/partiql-extension-ddl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repository.workspace = true
license = "Apache-2.0"
readme = "../../README.md"
keywords = ["sql", "ddl", "definition-language", "compilers", "interpreters"]
categories = ["database", "compilers",]
categories = ["database", "compilers", ]
exclude = [
"**/.git/**",
"**/.github/**",
Expand All @@ -23,15 +23,14 @@ bench = false
[dependencies]
partiql-types = { path = "../../partiql-types", version = "0.10.*" }

ion-rs = "0.18.1"
thiserror = "1.0"
miette = { version = "7.2", features = ["fancy"] }
miette = { version = "7", features = ["fancy"] }
time = { version = "0.3", features = ["formatting", "parsing", "serde"] }

indexmap = "2.2"
indexmap = "2.5"

[dev-dependencies]
criterion = "0.4"
criterion = "0.5"

[features]
default = []
3 changes: 0 additions & 3 deletions extension/partiql-extension-ddl/src/ddl.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use ion_rs::IonError;
use miette::Diagnostic;
use partiql_types::{
AnyOf, ArrayType, BagType, PartiqlShape, ShapeResultError, Static, StaticType, StructType,
Expand All @@ -13,8 +12,6 @@ use thiserror::Error;
pub enum ShapeEncodingError {
#[error("UnsupportedEncoding: {0}")]
UnsupportedEncoding(String),
#[error("IonEncodingError: {0}")]
IonEncodingError(#[from] IonError),
#[error("DateTimeEncodingError e: {0}")]
DateTimeEncodingError(#[from] time::error::Format),
#[error("Invalid Simulation Configuration e: {0}")]
Expand Down
31 changes: 16 additions & 15 deletions extension/partiql-extension-ion-functions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ readme = "../../README.md"
keywords = ["sql", "parser", "query", "compilers", "interpreters"]
categories = ["database", "compilers"]
exclude = [
"**/.git/**",
"**/.github/**",
"**/.travis.yml",
"**/.appveyor.yml",
"**/.git/**",
"**/.github/**",
"**/.travis.yml",
"**/.appveyor.yml",
]
version.workspace = true
edition.workspace = true
Expand All @@ -21,27 +21,28 @@ edition.workspace = true
bench = false

[dependencies]
partiql-extension-ion = {path = "../partiql-extension-ion", version = "0.10.*" }
partiql-extension-ion = { path = "../partiql-extension-ion", version = "0.10.*" }
partiql-value = { path = "../../partiql-value", version = "0.10.*" }
partiql-catalog = { path = "../../partiql-catalog", version = "0.10.*" }
partiql-logical = { path = "../../partiql-logical", version = "0.10.*" }

ordered-float = "3.*"
itertools = "0.10.*"
unicase = "2.6"
rust_decimal = { version = "1.25.0", default-features = false, features = ["std"] }
rust_decimal_macros = "1.26"
ion-rs = "0.18"
ordered-float = "4"
itertools = "0.13"
unicase = "2.7"
rust_decimal = { version = "1.36.0", default-features = false, features = ["std"] }
rust_decimal_macros = "1.36"
ion-rs_old = { version = "0.18", package = "ion-rs" }
ion-rs = { version = "1.0.0-rc.7", features = ["experimental"] }
time = { version = "0.3", features = ["macros"] }
once_cell = "1"
regex = "1.7"
regex = "1.10"
thiserror = "1.0"
delegate = "0.9"
zstd = "0.12"
delegate = "0.13"
zstd = "0.13"
flate2 = "1.0"

[dev-dependencies]
criterion = "0.4"
criterion = "0.5"
partiql-parser = { path = "../../partiql-parser", version = "0.10.*" }
partiql-logical = { path = "../../partiql-logical", version = "0.10.*" }
partiql-logical-planner = { path = "../../partiql-logical-planner", version = "0.10.*" }
Expand Down
4 changes: 2 additions & 2 deletions extension/partiql-extension-ion-functions/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![deny(rust_2018_idioms)]
#![deny(clippy::all)]

use ion_rs::data_source::ToIonDataSource;
use ion_rs_old::data_source::ToIonDataSource;
use partiql_catalog::call_defs::{CallDef, CallSpec, CallSpecArg};
use partiql_catalog::TableFunction;
use partiql_catalog::{
Expand Down Expand Up @@ -152,7 +152,7 @@ fn parse_ion_read<'a>(mut reader: impl 'a + Read + Seek) -> BaseTableExprResult<

fn parse_ion_buff<'a, I: 'a + ToIonDataSource>(input: I) -> BaseTableExprResult<'a> {
let err_map = |e| Box::new(e) as BaseTableExprResultError;
let reader = ion_rs::ReaderBuilder::new().build(input).unwrap();
let reader = ion_rs_old::ReaderBuilder::new().build(input).unwrap();
let decoder =
IonDecoderBuilder::new(IonDecoderConfig::default().with_mode(Encoding::Ion)).build(reader);
let decoder = decoder.map_err(err_map)?.map(move |it| it.map_err(err_map));
Expand Down
27 changes: 14 additions & 13 deletions extension/partiql-extension-ion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ readme = "../../README.md"
keywords = ["sql", "parser", "query", "compilers", "interpreters"]
categories = ["database", "compilers"]
exclude = [
"**/.git/**",
"**/.github/**",
"**/.travis.yml",
"**/.appveyor.yml",
"**/.git/**",
"**/.github/**",
"**/.travis.yml",
"**/.appveyor.yml",
]
version.workspace = true
edition.workspace = true
Expand All @@ -22,20 +22,21 @@ bench = false

[dependencies]
partiql-value = { path = "../../partiql-value", version = "0.10.*" }
ordered-float = "3.*"
itertools = "0.10.*"
unicase = "2.6"
rust_decimal = { version = "1.25.0", default-features = false, features = ["std"] }
rust_decimal_macros = "1.26"
ion-rs = "0.18"
ordered-float = "4"
itertools = "0.13"
unicase = "2.7"
rust_decimal = { version = "1.36.0", default-features = false, features = ["std"] }
rust_decimal_macros = "1.36"
ion-rs_old = { version = "0.18", package = "ion-rs" }
ion-rs = { version = "1.0.0-rc.7", features = ["experimental"] }
time = { version = "0.3", features = ["macros"] }
once_cell = "1"
regex = "1.7"
regex = "1.10"
thiserror = "1.0"
delegate = "0.9"
delegate = "0.13"

[dev-dependencies]
criterion = "0.4"
criterion = "0.5"

[features]
default = []
2 changes: 1 addition & 1 deletion extension/partiql-extension-ion/src/decode.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use delegate::delegate;
use ion_rs::{Decimal, Int, IonError, IonReader, IonType, StreamItem, Symbol};
use ion_rs_old::{Decimal, Int, IonError, IonReader, IonType, StreamItem, Symbol};
use once_cell::sync::Lazy;
use partiql_value::{Bag, DateTime, List, Tuple, Value};
use regex::RegexSet;
Expand Down
10 changes: 5 additions & 5 deletions extension/partiql-extension-ion/src/encode.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use delegate::delegate;

use ion_rs::{IonError, IonType, IonWriter};
use ion_rs_old::{IonError, IonType, IonWriter};
use ordered_float::OrderedFloat;
use partiql_value::{Bag, DateTime, List, Tuple, Value};
use rust_decimal::Decimal;
Expand Down Expand Up @@ -218,7 +218,7 @@ where
fn encode_decimal(&mut self, val: &Decimal) -> IonEncodeResult {
let scale = i64::from(val.scale());
let mantissa = val.mantissa();
let dec = ion_rs::Decimal::new(mantissa, -scale);
let dec = ion_rs_old::Decimal::new(mantissa, -scale);
Ok(self.writer.write_decimal(&dec)?)
}

Expand All @@ -233,7 +233,7 @@ where
fn encode_datetime(&mut self, val: &DateTime) -> IonEncodeResult {
match val {
DateTime::Timestamp(ts) => {
let ts = ion_rs::Timestamp::with_ymd(
let ts = ion_rs_old::Timestamp::with_ymd(
ts.year() as u32,
ts.month() as u32,
u32::from(ts.day()),
Expand All @@ -249,7 +249,7 @@ where
Ok(self.writer.write_timestamp(&ts)?)
}
DateTime::TimestampWithTz(ts) => {
let ts = ion_rs::Timestamp::with_ymd(
let ts = ion_rs_old::Timestamp::with_ymd(
ts.year() as u32,
ts.month() as u32,
u32::from(ts.day()),
Expand Down Expand Up @@ -334,7 +334,7 @@ where
self.inner
.writer
.set_annotations(std::iter::once(DATE_ANNOT));
let ts = ion_rs::Timestamp::with_ymd(
let ts = ion_rs_old::Timestamp::with_ymd(
date.year() as u32,
date.month() as u32,
u32::from(date.day()),
Expand Down
Loading

1 comment on commit 70b5ea2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PartiQL (rust) Benchmark

Benchmark suite Current: 70b5ea2 Previous: deff7a8 Ratio
arith_agg-avg 759500 ns/iter (± 1408) 767418 ns/iter (± 16285) 0.99
arith_agg-avg_distinct 849462 ns/iter (± 4155) 903823 ns/iter (± 3287) 0.94
arith_agg-count 806498 ns/iter (± 14064) 819135 ns/iter (± 12531) 0.98
arith_agg-count_distinct 843196 ns/iter (± 4176) 854689 ns/iter (± 1651) 0.99
arith_agg-min 813808 ns/iter (± 2458) 823294 ns/iter (± 3249) 0.99
arith_agg-min_distinct 848859 ns/iter (± 16282) 857361 ns/iter (± 2573) 0.99
arith_agg-max 814628 ns/iter (± 2353) 827553 ns/iter (± 2598) 0.98
arith_agg-max_distinct 862783 ns/iter (± 3478) 867044 ns/iter (± 28154) 1.00
arith_agg-sum 813703 ns/iter (± 2335) 822303 ns/iter (± 5920) 0.99
arith_agg-sum_distinct 846973 ns/iter (± 3297) 855984 ns/iter (± 2631) 0.99
arith_agg-avg-count-min-max-sum 943604 ns/iter (± 2933) 971203 ns/iter (± 6498) 0.97
arith_agg-avg-count-min-max-sum-group_by 1165672 ns/iter (± 16453) 1196258 ns/iter (± 5932) 0.97
arith_agg-avg-count-min-max-sum-group_by-group_as 1762193 ns/iter (± 14659) 1797637 ns/iter (± 8280) 0.98
arith_agg-avg_distinct-count_distinct-min_distinct-max_distinct-sum_distinct 1277611 ns/iter (± 15074) 1246192 ns/iter (± 18158) 1.03
arith_agg-avg_distinct-count_distinct-min_distinct-max_distinct-sum_distinct-group_by 1492997 ns/iter (± 19875) 1525246 ns/iter (± 14601) 0.98
arith_agg-avg_distinct-count_distinct-min_distinct-max_distinct-sum_distinct-group_by-group_as 2123779 ns/iter (± 12249) 2113403 ns/iter (± 18021) 1.00
parse-1 6113 ns/iter (± 45) 6086 ns/iter (± 42) 1.00
parse-15 49828 ns/iter (± 181) 52508 ns/iter (± 220) 0.95
parse-30 97703 ns/iter (± 288) 99616 ns/iter (± 183) 0.98
compile-1 4307 ns/iter (± 13) 4306 ns/iter (± 21) 1.00
compile-15 32139 ns/iter (± 155) 33549 ns/iter (± 283) 0.96
compile-30 67087 ns/iter (± 205) 69303 ns/iter (± 361) 0.97
plan-1 67118 ns/iter (± 1029) 67083 ns/iter (± 2328) 1.00
plan-15 1051816 ns/iter (± 9727) 1055829 ns/iter (± 17751) 1.00
plan-30 2104501 ns/iter (± 3002) 2106298 ns/iter (± 4583) 1.00
eval-1 12482615 ns/iter (± 60899) 12855153 ns/iter (± 122205) 0.97
eval-15 84866990 ns/iter (± 802755) 86807072 ns/iter (± 282541) 0.98
eval-30 163210743 ns/iter (± 892385) 167598895 ns/iter (± 2277227) 0.97
join 10122 ns/iter (± 43) 10468 ns/iter (± 20) 0.97
simple 2456 ns/iter (± 15) 2481 ns/iter (± 11) 0.99
simple-no 429 ns/iter (± 2) 418 ns/iter (± 1) 1.03
numbers 57 ns/iter (± 0) 57 ns/iter (± 0) 1
parse-simple 866 ns/iter (± 4) 838 ns/iter (± 8) 1.03
parse-ion 2616 ns/iter (± 4) 2827 ns/iter (± 14) 0.93
parse-group 7933 ns/iter (± 24) 7932 ns/iter (± 38) 1.00
parse-complex 20088 ns/iter (± 102) 20368 ns/iter (± 171) 0.99
parse-complex-fexpr 27415 ns/iter (± 84) 27608 ns/iter (± 138) 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.