Skip to content

Commit ddec665

Browse files
committed
chore(cubestore): Upgrade DF: Revert lowercasing in InlineTable::New, fix tests
Fixes case-insensitive comparisons in planning tests and lowercases appropriately in inline_tables[_2x] tests.
1 parent dc65247 commit ddec665

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

rust/cubestore/cubestore-sql-tests/src/tests.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6708,10 +6708,10 @@ async fn inline_tables(service: Box<dyn SqlClient>) {
67086708
);
67096709

67106710
let columns = vec![
6711-
Column::new("ID".to_string(), ColumnType::Int, 0),
6712-
Column::new("LastName".to_string(), ColumnType::String, 1),
6713-
Column::new("FirstName".to_string(), ColumnType::String, 2),
6714-
Column::new("Timestamp".to_string(), ColumnType::Timestamp, 3),
6711+
Column::new("id".to_string(), ColumnType::Int, 0),
6712+
Column::new("lastname".to_string(), ColumnType::String, 1),
6713+
Column::new("firstname".to_string(), ColumnType::String, 2),
6714+
Column::new("timestamp".to_string(), ColumnType::Timestamp, 3),
67156715
];
67166716
let rows = vec![
67176717
Row::new(vec![
@@ -6740,7 +6740,7 @@ async fn inline_tables(service: Box<dyn SqlClient>) {
67406740
]),
67416741
];
67426742
let data = Arc::new(DataFrame::new(columns, rows.clone()));
6743-
let inline_tables = vec![InlineTable::new(1000, "Persons".to_string(), data)];
6743+
let inline_tables = vec![InlineTable::new(1000, "persons".to_string(), data)];
67446744

67456745
let context = SqlQueryContext::default().with_inline_tables(&inline_tables);
67466746
let result = service
@@ -6849,9 +6849,9 @@ async fn inline_tables_2x(service: Box<dyn SqlClient>) {
68496849
.unwrap();
68506850

68516851
let columns = vec![
6852-
Column::new("ID".to_string(), ColumnType::Int, 0),
6853-
Column::new("Last".to_string(), ColumnType::String, 1),
6854-
Column::new("First".to_string(), ColumnType::String, 2),
6852+
Column::new("id".to_string(), ColumnType::Int, 0),
6853+
Column::new("last".to_string(), ColumnType::String, 1),
6854+
Column::new("first".to_string(), ColumnType::String, 2),
68556855
];
68566856
let rows = vec![
68576857
Row::new(vec![
@@ -6890,8 +6890,8 @@ async fn inline_tables_2x(service: Box<dyn SqlClient>) {
68906890
let data = Arc::new(DataFrame::new(columns.clone(), rows.clone()));
68916891
let data2 = Arc::new(DataFrame::new(columns.clone(), rows2.clone()));
68926892
let inline_tables = vec![
6893-
InlineTable::new(1000, "Persons".to_string(), data),
6894-
InlineTable::new(1001, "Persons2".to_string(), data2),
6893+
InlineTable::new(1000, "persons".to_string(), data),
6894+
InlineTable::new(1001, "persons2".to_string(), data2),
68956895
];
68966896

68976897
let context = SqlQueryContext::default().with_inline_tables(&inline_tables);

rust/cubestore/cubestore/src/queryplanner/planning.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2238,7 +2238,7 @@ pub mod tests {
22382238
"customer_registered_date",
22392239
]);
22402240
let customers = i.add_table(Table::new(
2241-
"Customers".to_string(),
2241+
"customers".to_string(),
22422242
SCHEMA,
22432243
customers_cols.clone(),
22442244
None,
@@ -2290,7 +2290,7 @@ pub mod tests {
22902290
"order_city",
22912291
]);
22922292
let orders = i.add_table(Table::new(
2293-
"Orders".to_string(),
2293+
"orders".to_string(),
22942294
SCHEMA,
22952295
orders_cols.clone(),
22962296
None,
@@ -2348,7 +2348,7 @@ pub mod tests {
23482348
}
23492349

23502350
i.add_table(Table::new(
2351-
"Products".to_string(),
2351+
"products".to_string(),
23522352
SCHEMA,
23532353
int_columns(&["product_id", "product_name"]),
23542354
None,
@@ -2467,7 +2467,7 @@ pub mod tests {
24672467
};
24682468
self.tables
24692469
.iter()
2470-
.find_position(|t| t.get_table_name().to_lowercase() == name.to_lowercase())
2470+
.find_position(|t| t.get_table_name() == name.as_ref())
24712471
.map(|(id, t)| -> Arc<dyn TableSource> {
24722472
let schema = Arc::new(ArrowSchema::new(
24732473
t.get_columns()

rust/cubestore/cubestore/src/sql/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pub type InlineTables = Vec<InlineTable>;
128128

129129
impl InlineTable {
130130
pub fn new(id: u64, name: String, data: Arc<DataFrame>) -> Self {
131-
Self { id, name: name.to_lowercase(), data: Arc::new(data.lowercase()) }
131+
Self { id, name, data }
132132
}
133133
}
134134

0 commit comments

Comments
 (0)