Skip to content

Commit

Permalink
Make partiql_value::parse_ion public (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
am357 authored Feb 9, 2023
1 parent 7e54311 commit b2ce0ce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Adds some benchmarks for parsing, compiling, planning, & evaluation
- Implements `PIVOT` operator in evaluator
- `serde` feature to `partiql-value` and `partiql-logical` with `Serialize` and `Deserialize` traits.
- Adds `Display` for `LogicalPlan`
- Expose `partiql_value::parse_ion` as a public API.

### Fixes

Expand Down
3 changes: 2 additions & 1 deletion partiql-value/src/ion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ use ion_rs::{Integer, IonReader, IonType, Reader, StreamItem};

// TODO handle errors more gracefully than `expect`/`unwrap`

pub(crate) fn parse_ion(contents: &str) -> Value {
/// For a given `contents` as Ion text produces a PartiQL Value
pub fn parse_ion(contents: &str) -> Value {
let mut reader = ion_rs::ReaderBuilder::new()
.build(contents)
.expect("reading contents");
Expand Down
2 changes: 1 addition & 1 deletion partiql-value/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use rust_decimal::prelude::FromPrimitive;
use rust_decimal::{Decimal as RustDecimal, Decimal};
use unicase::UniCase;

mod ion;
pub mod ion;

#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
Expand Down

1 comment on commit b2ce0ce

@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: b2ce0ce Previous: 7e54311 Ratio
parse-1 5606 ns/iter (± 118) 5622 ns/iter (± 15) 1.00
parse-15 52413 ns/iter (± 51) 53084 ns/iter (± 41) 0.99
parse-30 103485 ns/iter (± 83) 110263 ns/iter (± 394) 0.94
compile-1 16517 ns/iter (± 51) 16510 ns/iter (± 54) 1.00
compile-15 48863 ns/iter (± 245) 48665 ns/iter (± 305) 1.00
compile-30 89172 ns/iter (± 485) 88964 ns/iter (± 443) 1.00
plan-1 19254 ns/iter (± 50) 19477 ns/iter (± 22) 0.99
plan-15 364078 ns/iter (± 674) 362655 ns/iter (± 857) 1.00
plan-30 734342 ns/iter (± 1627) 731293 ns/iter (± 4368) 1.00
eval-1 21462446 ns/iter (± 158943) 21806108 ns/iter (± 211601) 0.98
eval-15 125592744 ns/iter (± 494778) 124854202 ns/iter (± 532431) 1.01
eval-30 245551563 ns/iter (± 984010) 244342899 ns/iter (± 416269) 1.00
join 14033 ns/iter (± 17) 13945 ns/iter (± 44) 1.01
simple 5373 ns/iter (± 7) 5330 ns/iter (± 7) 1.01
simple-no 2297 ns/iter (± 1) 2296 ns/iter (± 1) 1.00
numbers 107 ns/iter (± 0) 106 ns/iter (± 0) 1.01
parse-simple 646 ns/iter (± 0) 643 ns/iter (± 8) 1.00
parse-ion 2237 ns/iter (± 4) 2238 ns/iter (± 38) 1.00
parse-group 7663 ns/iter (± 12) 7625 ns/iter (± 12) 1.00
parse-complex 19188 ns/iter (± 43) 19325 ns/iter (± 467) 0.99
parse-complex-fexpr 29990 ns/iter (± 106) 29701 ns/iter (± 67) 1.01

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

Please sign in to comment.