Skip to content

Commit

Permalink
fix(cubestore): add custom type 'bytes', a synonym for 'varbinary' (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-biryukov committed Jan 26, 2021
1 parent 85456a4 commit 4efc291
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rust/cubestore/src/sql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ fn convert_columns_type(columns: &Vec<ColumnDef>) -> Result<Vec<Column>, CubeErr
let custom_type_name = custom.to_string().to_lowercase();
match custom_type_name.as_str() {
"mediumint" => ColumnType::Int,
"bytes" => ColumnType::Bytes,
"varbinary" => ColumnType::Bytes,
"hyperloglog" => ColumnType::HyperLogLog(HllFlavour::Airlift),
"hyperloglogpp" => ColumnType::HyperLogLog(HllFlavour::ZetaSketch),
Expand Down Expand Up @@ -1010,12 +1011,14 @@ mod tests {
service.exec_query("CREATE SCHEMA foo").await.unwrap();

service
.exec_query("CREATE TABLE foo.values (int_value mediumint)")
.exec_query("CREATE TABLE foo.values (int_value mediumint, b1 bytes, b2 varbinary)")
.await
.unwrap();

service
.exec_query("INSERT INTO foo.values (int_value) VALUES (-153)")
.exec_query(
"INSERT INTO foo.values (int_value, b1, b2) VALUES (-153, X'0a', X'0b')",
)
.await
.unwrap();
})
Expand Down

0 comments on commit 4efc291

Please sign in to comment.