Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 13 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions columnq/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "columnq"
version = "0.7.0"
version = "0.8.0"
homepage = "https://github.com/roapi/roapi"
license = "MIT"
authors = ["QP Hou <dave2008713@gmail.com>"]
Expand Down Expand Up @@ -62,7 +62,7 @@ features = ["default", "dst_arrow"]
optional = true

[dev-dependencies]
serde_yaml = "0.8"
serde_yaml = "0.9"
toml = "0.7"
tempfile = "3.3.0"
pretty_assertions = "*"
Expand Down
22 changes: 22 additions & 0 deletions columnq/src/table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,28 @@ batch_size: 512
assert_eq!(table_source.batch_size, 512);
}

#[test]
fn deserialize_datetime() {
let table_source: TableSource = serde_yaml::from_str(
r#"
name: "ts_table"
uri: "test_data/a.parquet"
schema:
columns:
- name: "ts"
data_type: !Timestamp [!Second, null]
"#,
)
.unwrap();

use arrow::datatypes::*;

assert_eq!(
DataType::Timestamp(TimeUnit::Second, None),
table_source.schema.unwrap().columns[0].data_type,
);
}

#[test]
fn test_parse_table_uri() {
let t = parse_table_uri_arg("t=a/b/c").unwrap();
Expand Down
4 changes: 2 additions & 2 deletions roapi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "roapi"
version = "0.10.0"
version = "0.11.0"
authors = ["QP Hou <dave2008713@gmail.com>"]
homepage = "https://github.com/roapi/roapi"
license = "MIT"
Expand Down Expand Up @@ -34,7 +34,7 @@ log = "0"
serde = { version = "1", features = ["rc"] }
serde_json = "1"
serde_derive = "1"
serde_yaml = "0.8"
serde_yaml = "0.9"
toml = "0.7"
clap = { version = "3", features = ["color"] }
thiserror = "1"
Expand Down
8 changes: 4 additions & 4 deletions roapi/src/server/flight_sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl<H: RoapiContext> FlightSqlService for RoapiFlightSqlService<H> {
info!("getting results for {handle}");
let result = self.get_result(&handle)?;
// if we get an empty result, create an empty schema
let (schema, batches) = match result.get(0) {
let (schema, batches) = match result.first() {
None => (Arc::new(Schema::empty()), vec![]),
Some(batch) => (batch.schema(), result.clone()),
};
Expand Down Expand Up @@ -286,7 +286,7 @@ impl<H: RoapiContext> FlightSqlService for RoapiFlightSqlService<H> {
.map_err(|e| internal_error!("Error executing query", e))?;

// if we get an empty result, create an empty schema
let schema = match result.get(0) {
let schema = match result.first() {
None => Schema::empty(),
Some(batch) => (*batch.schema()).clone(),
};
Expand Down Expand Up @@ -364,7 +364,7 @@ impl<H: RoapiContext> FlightSqlService for RoapiFlightSqlService<H> {
.map_err(|e| internal_error!("Error executing query", e))?;

// if we get an empty result, create an empty schema
let schema = match result.get(0) {
let schema = match result.first() {
None => Schema::empty(),
Some(batch) => (*batch.schema()).clone(),
};
Expand Down Expand Up @@ -632,7 +632,7 @@ impl<H: RoapiContext> FlightSqlService for RoapiFlightSqlService<H> {
// TODO: ignore SYSTEM TABLE and VIEW
let table_type = query
.table_types
.get(0)
.first()
.map(|s| s.as_str())
.unwrap_or_else(|| "table")
.to_string();
Expand Down