Skip to content

Commit

Permalink
chore: Reorganize deps and upgrade them (#110)
Browse files Browse the repository at this point in the history
* chore: Reorganize deps and upgrade them

Signed-off-by: Xuanwo <[email protected]>

* Fix order

Signed-off-by: Xuanwo <[email protected]>

* Format toml

Signed-off-by: Xuanwo <[email protected]>

---------

Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo authored Jul 2, 2024
1 parent 11b57b9 commit a57abda
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 25 deletions.
34 changes: 20 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,24 @@ include = ["src/**/*.rs", "Cargo.toml"]
rust-version = "1.70"

[dependencies]
anyhow = { version = "1.0", optional = true }
arrow = { version = "52", features = ["prettyprint", "chrono-tz"] }
async-trait = { version = "0.1.77", optional = true }
bytes = "1.4"
chrono = { version = "0.4.37", default-features = false, features = ["std"] }
chrono-tz = "0.8.6"
clap = { version = "4.5.4", features = ["derive"], optional = true }
datafusion = { version = "39.0.0", optional = true }
datafusion-expr = { version = "39.0.0", optional = true }
datafusion-physical-expr = { version = "39.0.0", optional = true }
chrono-tz = "0.9"
fallible-streaming-iterator = { version = "0.1" }
flate2 = "1"
futures = { version = "0.3", optional = true, default-features = false, features = ["std"] }
futures-util = { version = "0.3", optional = true }
lz4_flex = "0.11"
lzokay-native = "0.1"
num = "0.4.1"
object_store = { version = "0.10.1", optional = true }
prost = { version = "0.11" }
snafu = "0.7"
prost = { version = "0.12" }
snafu = "0.8"
snap = "1.1"
zstd = "0.12"

# async support
async-trait = { version = "0.1.77", optional = true }
futures = { version = "0.3", optional = true, default-features = false, features = ["std"] }
futures-util = { version = "0.3", optional = true }
tokio = { version = "1.28", optional = true, features = [
"io-util",
"sync",
Expand All @@ -41,10 +38,19 @@ tokio = { version = "1.28", optional = true, features = [
"rt",
"rt-multi-thread",
] }
zstd = "0.12"

# cli
anyhow = { version = "1.0", optional = true }
clap = { version = "4.5.4", features = ["derive"], optional = true }

# datafusion support
datafusion = { version = "39.0.0", optional = true }
datafusion-expr = { version = "39.0.0", optional = true }
datafusion-physical-expr = { version = "39.0.0", optional = true }
object_store = { version = "0.10.1", optional = true }

[dev-dependencies]
arrow-json = "51.0.0"
arrow-json = "52.0.0"
criterion = { version = "0.5", default-features = false, features = ["async_tokio"] }
pretty_assertions = "1.3.0"
serde_json = { version = "1.0", default-features = false, features = ["std"] }
Expand Down
79 changes: 68 additions & 11 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,54 @@ pub enum OrcError {
#[snafu(display("Failed to seek, source: {}", source))]
SeekError {
source: std::io::Error,
#[snafu(implicit)]
location: Location,
},

#[snafu(display("Failed to read, source: {}", source))]
IoError {
source: std::io::Error,
#[snafu(implicit)]
location: Location,
},

#[snafu(display("Empty file"))]
EmptyFile { location: Location },
EmptyFile {
#[snafu(implicit)]
location: Location,
},

#[snafu(display("Invalid input, message: {}", msg))]
InvalidInput { msg: String, location: Location },
InvalidInput {
msg: String,
#[snafu(implicit)]
location: Location,
},

#[snafu(display("Out of spec, message: {}", msg))]
OutOfSpec { msg: String, location: Location },
OutOfSpec {
msg: String,
#[snafu(implicit)]
location: Location,
},

#[snafu(display("Error from map builder: {}", source))]
MapBuilder {
source: arrow::error::ArrowError,
#[snafu(implicit)]
location: Location,
},

#[snafu(display("Failed to create new string builder: {}", source))]
StringBuilder {
source: arrow::error::ArrowError,
#[snafu(implicit)]
location: Location,
},

#[snafu(display("Failed to decode float, source: {}", source))]
DecodeFloat {
#[snafu(implicit)]
location: Location,
source: std::io::Error,
},
Expand All @@ -60,6 +76,7 @@ pub enum OrcError {
to_time_unit,
))]
DecodeTimestamp {
#[snafu(implicit)]
location: Location,
seconds: i64,
nanoseconds: u64,
Expand All @@ -68,97 +85,137 @@ pub enum OrcError {

#[snafu(display("Failed to decode proto, source: {}", source))]
DecodeProto {
#[snafu(implicit)]
location: Location,
source: prost::DecodeError,
},

#[snafu(display("No types found"))]
NoTypes { location: Location },
NoTypes {
#[snafu(implicit)]
location: Location,
},

#[snafu(display("unsupported type: {:?}", kind))]
UnsupportedType { location: Location, kind: Kind },
UnsupportedType {
#[snafu(implicit)]
location: Location,
kind: Kind,
},

#[snafu(display("unsupported type variant: {}", msg))]
UnsupportedTypeVariant {
#[snafu(implicit)]
location: Location,
msg: &'static str,
},

#[snafu(display("Field not found: {:?}", name))]
FieldNotFound { location: Location, name: String },
FieldNotFound {
#[snafu(implicit)]
location: Location,
name: String,
},

#[snafu(display("Invalid column : {:?}", name))]
InvalidColumn { location: Location, name: String },
InvalidColumn {
#[snafu(implicit)]
location: Location,
name: String,
},

#[snafu(display(
"Cannot decode ORC type {:?} into Arrow type {:?}",
orc_type,
arrow_type,
))]
MismatchedSchema {
#[snafu(implicit)]
location: Location,
orc_type: DataType,
arrow_type: ArrowDataType,
},

#[snafu(display("Invalid encoding for column '{}': {:?}", name, encoding))]
InvalidColumnEncoding {
#[snafu(implicit)]
location: Location,
name: String,
encoding: proto::column_encoding::Kind,
},

#[snafu(display("Failed to add day to a date"))]
AddDays { location: Location },
AddDays {
#[snafu(implicit)]
location: Location,
},

#[snafu(display("Invalid utf8, source: {}", source))]
InvalidUft8 {
#[snafu(implicit)]
location: Location,
source: FromUtf8Error,
},

#[snafu(display("Out of bound at: {}", index))]
OutOfBound { location: Location, index: usize },
OutOfBound {
#[snafu(implicit)]
location: Location,
index: usize,
},

#[snafu(display("Failed to convert to record batch: {}", source))]
ConvertRecordBatch {
#[snafu(implicit)]
location: Location,
source: ArrowError,
},

#[snafu(display("Varint being decoded is too large"))]
VarintTooLarge { location: Location },
VarintTooLarge {
#[snafu(implicit)]
location: Location,
},

#[snafu(display("unexpected: {}", msg))]
Unexpected { location: Location, msg: String },
Unexpected {
#[snafu(implicit)]
location: Location,
msg: String,
},

#[snafu(display("Failed to build zstd decoder: {}", source))]
BuildZstdDecoder {
#[snafu(implicit)]
location: Location,
source: io::Error,
},

#[snafu(display("Failed to build snappy decoder: {}", source))]
BuildSnappyDecoder {
#[snafu(implicit)]
location: Location,
source: snap::Error,
},

#[snafu(display("Failed to build lzo decoder: {}", source))]
BuildLzoDecoder {
#[snafu(implicit)]
location: Location,
source: lzokay_native::Error,
},

#[snafu(display("Failed to build lz4 decoder: {}", source))]
BuildLz4Decoder {
#[snafu(implicit)]
location: Location,
source: lz4_flex::block::DecompressError,
},

#[snafu(display("Arrow error: {}", source))]
Arrow {
source: arrow::error::ArrowError,
#[snafu(implicit)]
location: Location,
},
}
Expand Down

0 comments on commit a57abda

Please sign in to comment.