diff --git a/rust/cubesql/cubesql/src/compile/engine/context_mysql.rs b/rust/cubesql/cubesql/src/compile/engine/context_mysql.rs index 5e992c9cc26b3..d1681eca7e059 100644 --- a/rust/cubesql/cubesql/src/compile/engine/context_mysql.rs +++ b/rust/cubesql/cubesql/src/compile/engine/context_mysql.rs @@ -2,17 +2,6 @@ use std::sync::Arc; use datafusion::datasource::{self, TableProvider}; -use super::information_schema::mysql::{ - collations::InfoSchemaCollationsProvider as MySqlSchemaCollationsProvider, - columns::InfoSchemaColumnsProvider as MySqlSchemaColumnsProvider, - key_column_usage::InfoSchemaKeyColumnUsageProvider as MySqlSchemaKeyColumnUsageProvider, - processlist::InfoSchemaProcesslistProvider as MySqlSchemaProcesslistProvider, - referential_constraints::InfoSchemaReferentialConstraintsProvider as MySqlSchemaReferentialConstraintsProvider, - schemata::InfoSchemaSchemataProvider as MySqlSchemaSchemataProvider, - statistics::InfoSchemaStatisticsProvider as MySqlSchemaStatisticsProvider, - tables::InfoSchemaTableProvider as MySqlSchemaTableProvider, - variables::PerfSchemaVariablesProvider as MySqlPerfSchemaVariablesProvider, -}; use crate::{ compile::{ engine::{CubeContext, CubeTableProvider, TableName}, @@ -29,24 +18,6 @@ impl DatabaseProtocol { let any = table_provider.as_any(); Ok(if let Some(t) = any.downcast_ref::() { t.table_name().to_string() - } else if let Some(t) = any.downcast_ref::() { - t.table_name().to_string() - } else if let Some(t) = any.downcast_ref::() { - t.table_name().to_string() - } else if let Some(t) = any.downcast_ref::() { - t.table_name().to_string() - } else if let Some(t) = any.downcast_ref::() { - t.table_name().to_string() - } else if let Some(t) = any.downcast_ref::() { - t.table_name().to_string() - } else if let Some(t) = any.downcast_ref::() { - t.table_name().to_string() - } else if let Some(t) = any.downcast_ref::() { - t.table_name().to_string() - } else if let Some(t) = any.downcast_ref::() { - t.table_name().to_string() - } else if let Some(t) = any.downcast_ref::() { - t.table_name().to_string() } else { return Err(CubeError::internal(format!( "Unknown table provider with schema: {:?}", @@ -88,51 +59,6 @@ impl DatabaseProtocol { return None; } } - "information_schema" => match table.as_str() { - "tables" => { - return Some(Arc::new(MySqlSchemaTableProvider::new( - context.meta.clone(), - ))) - } - "columns" => { - return Some(Arc::new(MySqlSchemaColumnsProvider::new( - context.meta.clone(), - ))) - } - "statistics" => return Some(Arc::new(MySqlSchemaStatisticsProvider::new())), - "key_column_usage" => { - return Some(Arc::new(MySqlSchemaKeyColumnUsageProvider::new())) - } - "schemata" => return Some(Arc::new(MySqlSchemaSchemataProvider::new())), - "processlist" => { - return Some(Arc::new(MySqlSchemaProcesslistProvider::new( - context.sessions.clone(), - ))) - } - "referential_constraints" => { - return Some(Arc::new(MySqlSchemaReferentialConstraintsProvider::new())) - } - "collations" => return Some(Arc::new(MySqlSchemaCollationsProvider::new())), - _ => return None, - }, - "performance_schema" => match table.as_str() { - "global_variables" => { - return Some(Arc::new(MySqlPerfSchemaVariablesProvider::new( - "performance_schema.global_variables".to_string(), - context - .sessions - .server - .all_variables(context.session_state.protocol.clone()), - ))) - } - "session_variables" => { - return Some(Arc::new(MySqlPerfSchemaVariablesProvider::new( - "performance_schema.session_variables".to_string(), - context.session_state.all_variables(), - ))) - } - _ => return None, - }, _ => return None, } } diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/mod.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/mod.rs index 91a99f1ddfe81..c73e8ac43ad6a 100644 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/mod.rs +++ b/rust/cubesql/cubesql/src/compile/engine/information_schema/mod.rs @@ -1,4 +1,3 @@ -pub mod mysql; pub mod postgres; pub mod redshift; pub mod utils; diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/collations.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/collations.rs deleted file mode 100644 index 20842329539a1..0000000000000 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/collations.rs +++ /dev/null @@ -1,224 +0,0 @@ -use std::{any::Any, sync::Arc}; - -use crate::compile::engine::context::TableName; -use async_trait::async_trait; -use datafusion::{ - arrow::{ - array::{Array, ArrayRef, StringBuilder, UInt32Builder, UInt64Builder}, - datatypes::{DataType, Field, Schema, SchemaRef}, - record_batch::RecordBatch, - }, - datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, - error::DataFusionError, - logical_plan::Expr, - physical_plan::{memory::MemoryExec, ExecutionPlan}, -}; - -struct InformationSchemaCollationsBuilder { - collation_names: StringBuilder, - character_set_names: StringBuilder, - ids: UInt64Builder, - is_defaults: StringBuilder, - is_compiled_values: StringBuilder, - sortlens: UInt32Builder, - pad_attributes: StringBuilder, -} - -impl InformationSchemaCollationsBuilder { - fn new() -> Self { - let capacity = 10; - - Self { - collation_names: StringBuilder::new(capacity), - character_set_names: StringBuilder::new(capacity), - ids: UInt64Builder::new(capacity), - is_defaults: StringBuilder::new(capacity), - is_compiled_values: StringBuilder::new(capacity), - sortlens: UInt32Builder::new(capacity), - pad_attributes: StringBuilder::new(capacity), - } - } - - fn add_collation( - &mut self, - collation_name: impl AsRef, - character_set_name: impl AsRef, - id: u64, - is_default: bool, - sortlen: u32, - no_pad: bool, - ) { - self.collation_names - .append_value(collation_name.as_ref()) - .unwrap(); - self.character_set_names - .append_value(character_set_name.as_ref()) - .unwrap(); - self.ids.append_value(id).unwrap(); - self.is_defaults - .append_value((if is_default { "Yes" } else { "" }).to_string()) - .unwrap(); - self.is_compiled_values - .append_value("Yes".to_string()) - .unwrap(); - self.sortlens.append_value(sortlen).unwrap(); - self.pad_attributes - .append_value((if no_pad { "NO PAD" } else { "PAD SPACE" }).to_string()) - .unwrap(); - } - - fn finish(mut self) -> Vec> { - let columns: Vec> = vec![ - Arc::new(self.collation_names.finish()), - Arc::new(self.character_set_names.finish()), - Arc::new(self.ids.finish()), - Arc::new(self.is_defaults.finish()), - Arc::new(self.is_compiled_values.finish()), - Arc::new(self.sortlens.finish()), - Arc::new(self.pad_attributes.finish()), - ]; - - columns - } -} - -pub struct InfoSchemaCollationsProvider { - data: Arc>, -} - -impl TableName for InfoSchemaCollationsProvider { - fn table_name(&self) -> &str { - "information_schema.collations" - } -} - -impl InfoSchemaCollationsProvider { - pub fn new() -> Self { - let mut builder = InformationSchemaCollationsBuilder::new(); - - builder.add_collation("utf8mb4_general_ci", "utf8mb4", 45, false, 1, false); - builder.add_collation("utf8mb4_bin", "utf8mb4", 46, false, 1, false); - builder.add_collation("utf8mb4_unicode_ci", "utf8mb4", 224, false, 8, false); - builder.add_collation("utf8mb4_icelandic_ci", "utf8mb4", 225, false, 8, false); - builder.add_collation("utf8mb4_latvian_ci", "utf8mb4", 226, false, 8, false); - builder.add_collation("utf8mb4_romanian_ci", "utf8mb4", 227, false, 8, false); - builder.add_collation("utf8mb4_slovenian_ci", "utf8mb4", 228, false, 8, false); - builder.add_collation("utf8mb4_polish_ci", "utf8mb4", 229, false, 8, false); - builder.add_collation("utf8mb4_estonian_ci", "utf8mb4", 230, false, 8, false); - builder.add_collation("utf8mb4_spanish_ci", "utf8mb4", 231, false, 8, false); - builder.add_collation("utf8mb4_swedish_ci", "utf8mb4", 232, false, 8, false); - builder.add_collation("utf8mb4_turkish_ci", "utf8mb4", 233, false, 8, false); - builder.add_collation("utf8mb4_czech_ci", "utf8mb4", 234, false, 8, false); - builder.add_collation("utf8mb4_danish_ci", "utf8mb4", 235, false, 8, false); - builder.add_collation("utf8mb4_lithuanian_ci", "utf8mb4", 236, false, 8, false); - builder.add_collation("utf8mb4_slovak_ci", "utf8mb4", 237, false, 8, false); - builder.add_collation("utf8mb4_spanish2_ci", "utf8mb4", 238, false, 8, false); - builder.add_collation("utf8mb4_roman_ci", "utf8mb4", 239, false, 8, false); - builder.add_collation("utf8mb4_persian_ci", "utf8mb4", 240, false, 8, false); - builder.add_collation("utf8mb4_esperanto_ci", "utf8mb4", 241, false, 8, false); - builder.add_collation("utf8mb4_hungarian_ci", "utf8mb4", 242, false, 8, false); - builder.add_collation("utf8mb4_sinhala_ci", "utf8mb4", 243, false, 8, false); - builder.add_collation("utf8mb4_german2_ci", "utf8mb4", 244, false, 8, false); - builder.add_collation("utf8mb4_croatian_ci", "utf8mb4", 245, false, 8, false); - builder.add_collation("utf8mb4_unicode_520_ci", "utf8mb4", 246, false, 8, false); - builder.add_collation("utf8mb4_vietnamese_ci", "utf8mb4", 247, false, 8, false); - builder.add_collation("utf8mb4_0900_ai_ci", "utf8mb4", 255, true, 0, true); - builder.add_collation("utf8mb4_de_pb_0900_ai_ci", "utf8mb4", 256, false, 0, true); - builder.add_collation("utf8mb4_is_0900_ai_ci", "utf8mb4", 257, false, 0, true); - builder.add_collation("utf8mb4_lv_0900_ai_ci", "utf8mb4", 258, false, 0, true); - builder.add_collation("utf8mb4_ro_0900_ai_ci", "utf8mb4", 259, false, 0, true); - builder.add_collation("utf8mb4_sl_0900_ai_ci", "utf8mb4", 260, false, 0, true); - builder.add_collation("utf8mb4_pl_0900_ai_ci", "utf8mb4", 261, false, 0, true); - builder.add_collation("utf8mb4_et_0900_ai_ci", "utf8mb4", 262, false, 0, true); - builder.add_collation("utf8mb4_es_0900_ai_ci", "utf8mb4", 263, false, 0, true); - builder.add_collation("utf8mb4_sv_0900_ai_ci", "utf8mb4", 264, false, 0, true); - builder.add_collation("utf8mb4_tr_0900_ai_ci", "utf8mb4", 265, false, 0, true); - builder.add_collation("utf8mb4_cs_0900_ai_ci", "utf8mb4", 266, false, 0, true); - builder.add_collation("utf8mb4_da_0900_ai_ci", "utf8mb4", 267, false, 0, true); - builder.add_collation("utf8mb4_lt_0900_ai_ci", "utf8mb4", 268, false, 0, true); - builder.add_collation("utf8mb4_sk_0900_ai_ci", "utf8mb4", 269, false, 0, true); - builder.add_collation("utf8mb4_es_trad_0900_ai_ci", "utf8mb4", 270, false, 0, true); - builder.add_collation("utf8mb4_la_0900_ai_ci", "utf8mb4", 271, false, 0, true); - builder.add_collation("utf8mb4_eo_0900_ai_ci", "utf8mb4", 273, false, 0, true); - builder.add_collation("utf8mb4_hu_0900_ai_ci", "utf8mb4", 274, false, 0, true); - builder.add_collation("utf8mb4_hr_0900_ai_ci", "utf8mb4", 275, false, 0, true); - builder.add_collation("utf8mb4_vi_0900_ai_ci", "utf8mb4", 277, false, 0, true); - builder.add_collation("utf8mb4_0900_as_cs", "utf8mb4", 278, false, 0, true); - builder.add_collation("utf8mb4_de_pb_0900_as_cs", "utf8mb4", 279, false, 0, true); - builder.add_collation("utf8mb4_is_0900_as_cs", "utf8mb4", 280, false, 0, true); - builder.add_collation("utf8mb4_lv_0900_as_cs", "utf8mb4", 281, false, 0, true); - builder.add_collation("utf8mb4_ro_0900_as_cs", "utf8mb4", 282, false, 0, true); - builder.add_collation("utf8mb4_sl_0900_as_cs", "utf8mb4", 283, false, 0, true); - builder.add_collation("utf8mb4_pl_0900_as_cs", "utf8mb4", 284, false, 0, true); - builder.add_collation("utf8mb4_et_0900_as_cs", "utf8mb4", 285, false, 0, true); - builder.add_collation("utf8mb4_es_0900_as_cs", "utf8mb4", 286, false, 0, true); - builder.add_collation("utf8mb4_sv_0900_as_cs", "utf8mb4", 287, false, 0, true); - builder.add_collation("utf8mb4_tr_0900_as_cs", "utf8mb4", 288, false, 0, true); - builder.add_collation("utf8mb4_cs_0900_as_cs", "utf8mb4", 289, false, 0, true); - builder.add_collation("utf8mb4_da_0900_as_cs", "utf8mb4", 290, false, 0, true); - builder.add_collation("utf8mb4_lt_0900_as_cs", "utf8mb4", 291, false, 0, true); - builder.add_collation("utf8mb4_sk_0900_as_cs", "utf8mb4", 292, false, 0, true); - builder.add_collation("utf8mb4_es_trad_0900_as_cs", "utf8mb4", 293, false, 0, true); - builder.add_collation("utf8mb4_la_0900_as_cs", "utf8mb4", 294, false, 0, true); - builder.add_collation("utf8mb4_eo_0900_as_cs", "utf8mb4", 296, false, 0, true); - builder.add_collation("utf8mb4_hu_0900_as_cs", "utf8mb4", 297, false, 0, true); - builder.add_collation("utf8mb4_hr_0900_as_cs", "utf8mb4", 298, false, 0, true); - builder.add_collation("utf8mb4_vi_0900_as_cs", "utf8mb4", 300, false, 0, true); - builder.add_collation("utf8mb4_ja_0900_as_cs", "utf8mb4", 303, false, 0, true); - builder.add_collation("utf8mb4_ja_0900_as_cs_ks", "utf8mb4", 304, false, 24, true); - builder.add_collation("utf8mb4_0900_as_ci", "utf8mb4", 305, false, 0, true); - builder.add_collation("utf8mb4_ru_0900_ai_ci", "utf8mb4", 306, false, 0, true); - builder.add_collation("utf8mb4_ru_0900_as_cs", "utf8mb4", 307, false, 0, true); - builder.add_collation("utf8mb4_zh_0900_as_cs", "utf8mb4", 308, false, 0, true); - builder.add_collation("utf8mb4_0900_bin", "utf8mb4", 309, false, 1, true); - - Self { - data: Arc::new(builder.finish()), - } - } -} - -#[async_trait] -impl TableProvider for InfoSchemaCollationsProvider { - fn as_any(&self) -> &dyn Any { - self - } - - fn table_type(&self) -> TableType { - TableType::View - } - - fn schema(&self) -> SchemaRef { - Arc::new(Schema::new(vec![ - Field::new("COLLATION_NAME", DataType::Utf8, false), - Field::new("CHARACTER_SET_NAME", DataType::Utf8, false), - Field::new("ID", DataType::UInt64, false), - Field::new("IS_DEFAULT", DataType::Utf8, false), - Field::new("IS_COMPILED", DataType::Utf8, false), - Field::new("SORTLEN", DataType::UInt32, false), - Field::new("PAD_ATTRIBUTE", DataType::Utf8, false), - ])) - } - - async fn scan( - &self, - projection: &Option>, - _filters: &[Expr], - _limit: Option, - ) -> Result, DataFusionError> { - let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; - - Ok(Arc::new(MemoryExec::try_new( - &[vec![batch]], - self.schema(), - projection.clone(), - )?)) - } - - fn supports_filter_pushdown( - &self, - _filter: &Expr, - ) -> Result { - Ok(TableProviderFilterPushDown::Unsupported) - } -} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/columns.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/columns.rs deleted file mode 100644 index bb3071bbd0b06..0000000000000 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/columns.rs +++ /dev/null @@ -1,233 +0,0 @@ -use std::{any::Any, sync::Arc}; - -use async_trait::async_trait; -use datafusion::{ - arrow::{ - array::{Array, ArrayRef, StringBuilder, UInt32Builder}, - datatypes::{DataType, Field, Schema, SchemaRef}, - record_batch::RecordBatch, - }, - datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, - error::DataFusionError, - logical_plan::Expr, - physical_plan::{memory::MemoryExec, ExecutionPlan}, -}; - -use crate::transport::{CubeColumn, MetaContext, V1CubeMetaExt}; - -use super::{ext::CubeColumnMySqlExt, utils::new_string_array_with_placeholder}; -use crate::compile::engine::context::TableName; - -struct InformationSchemaColumnsBuilder { - catalog_names: StringBuilder, - schema_names: StringBuilder, - table_names: StringBuilder, - column_names: StringBuilder, - ordinal_positions: UInt32Builder, - column_default: StringBuilder, - is_nullable: StringBuilder, - data_type: StringBuilder, - char_max_length: UInt32Builder, - char_octet_length: UInt32Builder, - column_type: StringBuilder, - numeric_scale: UInt32Builder, - numeric_precision: UInt32Builder, - datetime_precision: UInt32Builder, -} - -impl InformationSchemaColumnsBuilder { - fn new() -> Self { - let capacity = 10; - - Self { - catalog_names: StringBuilder::new(capacity), - schema_names: StringBuilder::new(capacity), - table_names: StringBuilder::new(capacity), - column_names: StringBuilder::new(capacity), - ordinal_positions: UInt32Builder::new(capacity), - column_default: StringBuilder::new(capacity), - is_nullable: StringBuilder::new(capacity), - data_type: StringBuilder::new(capacity), - char_max_length: UInt32Builder::new(capacity), - char_octet_length: UInt32Builder::new(capacity), - column_type: StringBuilder::new(capacity), - numeric_precision: UInt32Builder::new(capacity), - numeric_scale: UInt32Builder::new(capacity), - datetime_precision: UInt32Builder::new(capacity), - } - } - - fn add_column( - &mut self, - catalog_name: impl AsRef, - schema_name: impl AsRef, - table_name: impl AsRef, - column: &CubeColumn, - ordinal_position: u32, - ) { - self.catalog_names - .append_value(catalog_name.as_ref()) - .unwrap(); - self.schema_names - .append_value(schema_name.as_ref()) - .unwrap(); - self.table_names.append_value(table_name.as_ref()).unwrap(); - self.column_names.append_value(column.get_name()).unwrap(); - self.ordinal_positions - .append_value(ordinal_position) - .unwrap(); - self.column_default.append_value("").unwrap(); - self.is_nullable - .append_value(if column.sql_can_be_null() { - "YES" - } else { - "NO" - }) - .unwrap(); - - self.data_type.append_value(column.get_data_type()).unwrap(); - self.column_type - .append_value(column.get_mysql_column_type()) - .unwrap(); - - self.char_max_length.append_null().unwrap(); - self.char_octet_length.append_null().unwrap(); - self.numeric_precision.append_null().unwrap(); - self.numeric_scale.append_null().unwrap(); - self.datetime_precision.append_null().unwrap(); - } - - fn finish(mut self) -> Vec> { - let mut columns: Vec> = vec![]; - - let catalog_names = self.catalog_names.finish(); - let total = catalog_names.len(); - columns.push(Arc::new(catalog_names)); - columns.push(Arc::new(self.schema_names.finish())); - columns.push(Arc::new(self.table_names.finish())); - columns.push(Arc::new(self.column_names.finish())); - columns.push(Arc::new(self.ordinal_positions.finish())); - columns.push(Arc::new(self.column_default.finish())); - columns.push(Arc::new(self.is_nullable.finish())); - columns.push(Arc::new(self.data_type.finish())); - columns.push(Arc::new(self.char_max_length.finish())); - columns.push(Arc::new(self.char_octet_length.finish())); - columns.push(Arc::new(self.column_type.finish())); - columns.push(Arc::new(self.numeric_precision.finish())); - columns.push(Arc::new(self.numeric_scale.finish())); - columns.push(Arc::new(self.datetime_precision.finish())); - - // COLUMN_KEY - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - // EXTRA - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - // COLUMN_COMMENT - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - // GENERATION_EXPRESSION - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - // SRS_ID - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - - columns - } -} - -pub struct InfoSchemaColumnsProvider { - data: Arc>, -} - -impl TableName for InfoSchemaColumnsProvider { - fn table_name(&self) -> &str { - "information_schema.columns" - } -} - -impl InfoSchemaColumnsProvider { - pub fn new(meta: Arc) -> Self { - let mut builder = InformationSchemaColumnsBuilder::new(); - - for cube in meta.cubes.iter() { - let position = 0; - - for column in cube.get_columns() { - builder.add_column("def", "db", cube.name.clone(), &column, position) - } - } - - Self { - data: Arc::new(builder.finish()), - } - } -} - -#[async_trait] -impl TableProvider for InfoSchemaColumnsProvider { - fn as_any(&self) -> &dyn Any { - self - } - - fn table_type(&self) -> TableType { - TableType::View - } - - fn schema(&self) -> SchemaRef { - Arc::new(Schema::new(vec![ - Field::new("TABLE_CATALOG", DataType::Utf8, false), - Field::new("TABLE_SCHEMA", DataType::Utf8, false), - Field::new("TABLE_NAME", DataType::Utf8, false), - Field::new("COLUMN_NAME", DataType::Utf8, false), - Field::new("ORDINAL_POSITION", DataType::UInt32, false), - Field::new("COLUMN_DEFAULT", DataType::Utf8, true), - Field::new("IS_NULLABLE", DataType::Utf8, false), - Field::new("DATA_TYPE", DataType::Utf8, false), - Field::new("CHARACTER_MAXIMUM_LENGTH", DataType::UInt32, true), - Field::new("CHARACTER_OCTET_LENGTH", DataType::UInt32, true), - Field::new("COLUMN_TYPE", DataType::Utf8, false), - Field::new("NUMERIC_PRECISION", DataType::UInt32, true), - Field::new("NUMERIC_SCALE", DataType::UInt32, true), - Field::new("DATETIME_PRECISION", DataType::UInt32, true), - Field::new("COLUMN_KEY", DataType::Utf8, false), - Field::new("EXTRA", DataType::Utf8, false), - Field::new("COLUMN_COMMENT", DataType::Utf8, false), - Field::new("GENERATION_EXPRESSION", DataType::Utf8, false), - Field::new("SRS_ID", DataType::Utf8, true), - ])) - } - - async fn scan( - &self, - projection: &Option>, - _filters: &[Expr], - _limit: Option, - ) -> Result, DataFusionError> { - let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; - - Ok(Arc::new(MemoryExec::try_new( - &[vec![batch]], - self.schema(), - projection.clone(), - )?)) - } - - fn supports_filter_pushdown( - &self, - _filter: &Expr, - ) -> Result { - Ok(TableProviderFilterPushDown::Unsupported) - } -} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/ext.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/ext.rs deleted file mode 100644 index 642af5169ef43..0000000000000 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/ext.rs +++ /dev/null @@ -1,30 +0,0 @@ -use crate::{sql::ColumnType, transport::CubeColumn}; - -pub trait CubeColumnMySqlExt { - fn get_data_type(&self) -> String; - fn get_mysql_column_type(&self) -> String; -} - -impl CubeColumnMySqlExt for CubeColumn { - fn get_data_type(&self) -> String { - match self.get_column_type() { - ColumnType::Timestamp => "datetime".to_string(), - ColumnType::Int64 => "int".to_string(), - ColumnType::Double => "numeric".to_string(), - // bool, boolean is an alias for tinyint(1) - ColumnType::Boolean => "tinyint(1)".to_string(), - _ => "varchar".to_string(), - } - } - - fn get_mysql_column_type(&self) -> String { - match self.get_column_type() { - ColumnType::Timestamp => "datetime".to_string(), - ColumnType::Int64 => "int".to_string(), - ColumnType::Double => "numeric".to_string(), - // bool, boolean is an alias for tinyint(1) - ColumnType::Boolean => "tinyint(1)".to_string(), - _ => "varchar(255)".to_string(), - } - } -} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/key_column_usage.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/key_column_usage.rs deleted file mode 100644 index 78817845b1535..0000000000000 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/key_column_usage.rs +++ /dev/null @@ -1,101 +0,0 @@ -use std::{any::Any, sync::Arc}; - -use async_trait::async_trait; -use datafusion::{ - arrow::{ - array::Array, - datatypes::{DataType, Field, Schema, SchemaRef}, - record_batch::RecordBatch, - }, - datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, - error::DataFusionError, - logical_plan::Expr, - physical_plan::{memory::MemoryExec, ExecutionPlan}, -}; - -use super::utils::{ - new_boolean_array_with_placeholder, new_string_array_with_placeholder, - new_uint32_array_with_placeholder, -}; -use crate::compile::engine::context::TableName; - -pub struct InfoSchemaKeyColumnUsageProvider {} - -impl InfoSchemaKeyColumnUsageProvider { - pub fn new() -> Self { - Self {} - } -} - -impl TableName for InfoSchemaKeyColumnUsageProvider { - fn table_name(&self) -> &str { - "information_schema.key_column_usage" - } -} - -#[async_trait] -impl TableProvider for InfoSchemaKeyColumnUsageProvider { - fn as_any(&self) -> &dyn Any { - self - } - - fn table_type(&self) -> TableType { - TableType::View - } - - fn schema(&self) -> SchemaRef { - Arc::new(Schema::new(vec![ - Field::new("CONSTRAINT_CATALOG", DataType::Utf8, false), - Field::new("CONSTRAINT_SCHEMA", DataType::Utf8, false), - Field::new("CONSTRAINT_NAME", DataType::Utf8, false), - Field::new("TABLE_CATALOG", DataType::Utf8, false), - Field::new("TABLE_SCHEMA", DataType::Utf8, false), - Field::new("TABLE_NAME", DataType::Utf8, false), - Field::new("COLUMN_NAME", DataType::Utf8, false), - Field::new("ORDINAL_POSITION", DataType::UInt32, false), - Field::new("POSITION_IN_UNIQUE_CONSTRAINT", DataType::Boolean, true), - Field::new("REFERENCED_TABLE_SCHEMA", DataType::Utf8, false), - Field::new("REFERENCED_TABLE_NAME", DataType::Utf8, false), - Field::new("REFERENCED_COLUMN_NAME", DataType::Utf8, false), - ])) - } - - async fn scan( - &self, - projection: &Option>, - _filters: &[Expr], - _limit: Option, - ) -> Result, DataFusionError> { - let data: Vec> = vec![ - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - // ORDINAL_POSITION - Arc::new(new_uint32_array_with_placeholder(0, 0)), - // POSITION_IN_UNIQUE_CONSTRAINT - Arc::new(new_boolean_array_with_placeholder(0, false)), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - ]; - - let batch = RecordBatch::try_new(self.schema(), data)?; - - Ok(Arc::new(MemoryExec::try_new( - &[vec![batch]], - self.schema(), - projection.clone(), - )?)) - } - - fn supports_filter_pushdown( - &self, - _filter: &Expr, - ) -> Result { - Ok(TableProviderFilterPushDown::Unsupported) - } -} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/mod.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/mod.rs deleted file mode 100644 index 23def2442eeae..0000000000000 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/mod.rs +++ /dev/null @@ -1,12 +0,0 @@ -pub mod collations; -pub mod columns; -pub mod ext; -pub mod key_column_usage; -pub mod processlist; -pub mod referential_constraints; -pub mod schemata; -pub mod statistics; -pub mod tables; -pub mod variables; - -use super::utils; diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/processlist.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/processlist.rs deleted file mode 100644 index 09364dba6769e..0000000000000 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/processlist.rs +++ /dev/null @@ -1,156 +0,0 @@ -use std::{any::Any, sync::Arc}; - -use async_trait::async_trait; -use datafusion::{ - arrow::{ - array::{Array, StringBuilder, UInt32Builder}, - datatypes::{DataType, Field, Schema, SchemaRef}, - record_batch::RecordBatch, - }, - datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, - error::DataFusionError, - logical_plan::Expr, - physical_plan::{memory::MemoryExec, ExecutionPlan}, -}; - -use crate::sql::{SessionManager, SessionProcessList}; - -use super::utils::new_string_array_with_placeholder; -use crate::compile::engine::context::TableName; - -struct InformationSchemaProcesslistBuilder { - id: UInt32Builder, - user: StringBuilder, - host: StringBuilder, - db: StringBuilder, - command: StringBuilder, - time: UInt32Builder, - state: StringBuilder, - // info: StringBuilder, -} - -impl InformationSchemaProcesslistBuilder { - fn new() -> Self { - let capacity = 10; - - Self { - id: UInt32Builder::new(capacity), - user: StringBuilder::new(capacity), - host: StringBuilder::new(capacity), - db: StringBuilder::new(capacity), - command: StringBuilder::new(capacity), - time: UInt32Builder::new(capacity), - state: StringBuilder::new(capacity), - // info: StringBuilder::new(capacity), - } - } - - fn add_row(&mut self, process_list: SessionProcessList) { - self.id.append_value(process_list.id).unwrap(); - - if let Some(user) = process_list.user { - self.user.append_value(user).unwrap(); - } else { - self.user.append_null().unwrap(); - } - - self.host.append_value(process_list.host).unwrap(); - - if let Some(database) = process_list.database { - self.db.append_value(database).unwrap(); - } else { - self.db.append_null().unwrap(); - } - - self.command.append_value("daemon").unwrap(); - self.time.append_value(0).unwrap(); - self.state.append_value("Waiting on empty queue").unwrap(); - } - - fn finish(mut self) -> Vec> { - let state = self.state.finish(); - let total = state.len(); - - let columns: Vec> = vec![ - Arc::new(self.id.finish()), - Arc::new(self.user.finish()), - Arc::new(self.host.finish()), - Arc::new(self.db.finish()), - Arc::new(self.command.finish()), - Arc::new(self.time.finish()), - Arc::new(state), - Arc::new(new_string_array_with_placeholder(total, None)), - ]; - - columns - } -} - -pub struct InfoSchemaProcesslistProvider { - sessions: Arc, -} - -impl TableName for InfoSchemaProcesslistProvider { - fn table_name(&self) -> &str { - "information_schema.processlist" - } -} - -impl InfoSchemaProcesslistProvider { - pub fn new(sessions: Arc) -> Self { - Self { sessions } - } -} - -#[async_trait] -impl TableProvider for InfoSchemaProcesslistProvider { - fn as_any(&self) -> &dyn Any { - self - } - - fn table_type(&self) -> TableType { - TableType::View - } - - fn schema(&self) -> SchemaRef { - Arc::new(Schema::new(vec![ - Field::new("ID", DataType::UInt32, false), - // @todo Null support? - Field::new("USER", DataType::Utf8, true), - Field::new("HOST", DataType::Utf8, false), - Field::new("DB", DataType::Utf8, true), - Field::new("COMMAND", DataType::Utf8, false), - Field::new("TIME", DataType::UInt32, false), - Field::new("STATE", DataType::Utf8, false), - Field::new("INFO", DataType::Utf8, true), - ])) - } - - async fn scan( - &self, - projection: &Option>, - _filters: &[Expr], - _limit: Option, - ) -> Result, DataFusionError> { - let mut builder = InformationSchemaProcesslistBuilder::new(); - - for process_list in self.sessions.map_sessions::().await { - builder.add_row(process_list); - } - - let batch = RecordBatch::try_new(self.schema(), builder.finish())?; - - Ok(Arc::new(MemoryExec::try_new( - &[vec![batch]], - self.schema(), - projection.clone(), - )?)) - } - - fn supports_filter_pushdown( - &self, - _filter: &Expr, - ) -> Result { - Ok(TableProviderFilterPushDown::Unsupported) - } -} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/referential_constraints.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/referential_constraints.rs deleted file mode 100644 index 3315552a36ec4..0000000000000 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/referential_constraints.rs +++ /dev/null @@ -1,94 +0,0 @@ -use std::{any::Any, sync::Arc}; - -use async_trait::async_trait; -use datafusion::{ - arrow::{ - array::Array, - datatypes::{DataType, Field, Schema, SchemaRef}, - record_batch::RecordBatch, - }, - datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, - error::DataFusionError, - logical_plan::Expr, - physical_plan::{memory::MemoryExec, ExecutionPlan}, -}; - -use super::utils::new_string_array_with_placeholder; -use crate::compile::engine::context::TableName; - -pub struct InfoSchemaReferentialConstraintsProvider {} - -impl InfoSchemaReferentialConstraintsProvider { - pub fn new() -> Self { - Self {} - } -} - -impl TableName for InfoSchemaReferentialConstraintsProvider { - fn table_name(&self) -> &str { - "information_schema.referential_constraints" - } -} - -#[async_trait] -impl TableProvider for InfoSchemaReferentialConstraintsProvider { - fn as_any(&self) -> &dyn Any { - self - } - - fn table_type(&self) -> TableType { - TableType::View - } - - fn schema(&self) -> SchemaRef { - Arc::new(Schema::new(vec![ - Field::new("CONSTRAINT_CATALOG", DataType::Utf8, false), - Field::new("CONSTRAINT_SCHEMA", DataType::Utf8, false), - Field::new("CONSTRAINT_NAME", DataType::Utf8, false), - Field::new("UNIQUE_CONSTRAINT_CATALOG", DataType::Utf8, false), - Field::new("UNIQUE_CONSTRAINT_SCHEMA", DataType::Utf8, false), - Field::new("UNIQUE_CONSTRAINT_NAME", DataType::Utf8, false), - Field::new("MATCH_OPTION", DataType::Utf8, false), - Field::new("UPDATE_RULE", DataType::Utf8, false), - Field::new("DELETE_RULE", DataType::Utf8, false), - Field::new("TABLE_NAME", DataType::Utf8, false), - Field::new("REFERENCED_TABLE_NAME", DataType::Utf8, false), - ])) - } - - async fn scan( - &self, - projection: &Option>, - _filters: &[Expr], - _limit: Option, - ) -> Result, DataFusionError> { - let data: Vec> = vec![ - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - Arc::new(new_string_array_with_placeholder(0, Some("".to_string()))), - ]; - - let batch = RecordBatch::try_new(self.schema(), data)?; - - Ok(Arc::new(MemoryExec::try_new( - &[vec![batch]], - self.schema(), - projection.clone(), - )?)) - } - - fn supports_filter_pushdown( - &self, - _filter: &Expr, - ) -> Result { - Ok(TableProviderFilterPushDown::Unsupported) - } -} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/schemata.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/schemata.rs deleted file mode 100644 index c877a5e4c5089..0000000000000 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/schemata.rs +++ /dev/null @@ -1,145 +0,0 @@ -use std::{any::Any, sync::Arc}; - -use async_trait::async_trait; - -use datafusion::{ - arrow::{ - array::{Array, ArrayRef, StringBuilder}, - datatypes::{DataType, Field, Schema, SchemaRef}, - record_batch::RecordBatch, - }, - datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, - error::DataFusionError, - logical_plan::Expr, - physical_plan::{memory::MemoryExec, ExecutionPlan}, -}; - -use super::utils::new_string_array_with_placeholder; -use crate::compile::engine::context::TableName; - -struct InformationSchemaSchemataBuilder { - catalog_names: StringBuilder, - schema_names: StringBuilder, - default_character_set_names: StringBuilder, - default_collation_names: StringBuilder, -} - -impl InformationSchemaSchemataBuilder { - fn new() -> Self { - let capacity = 10; - - Self { - catalog_names: StringBuilder::new(capacity), - schema_names: StringBuilder::new(capacity), - default_character_set_names: StringBuilder::new(capacity), - default_collation_names: StringBuilder::new(capacity), - } - } - - fn add_schema( - &mut self, - schema_name: impl AsRef, - default_character_set_name: impl AsRef, - default_collation_name: impl AsRef, - ) { - self.catalog_names.append_value("def").unwrap(); - self.schema_names - .append_value(schema_name.as_ref()) - .unwrap(); - self.default_character_set_names - .append_value(default_character_set_name.as_ref()) - .unwrap(); - self.default_collation_names - .append_value(default_collation_name.as_ref()) - .unwrap(); - } - - fn finish(mut self) -> Vec> { - let mut columns: Vec> = vec![]; - let catalog_names = self.catalog_names.finish(); - let total = catalog_names.len(); - - columns.push(Arc::new(catalog_names)); - columns.push(Arc::new(self.schema_names.finish())); - columns.push(Arc::new(self.default_character_set_names.finish())); - columns.push(Arc::new(self.default_collation_names.finish())); - - columns.push(Arc::new(new_string_array_with_placeholder(total, None))); - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("NO".to_string()), - ))); - - columns - } -} - -pub struct InfoSchemaSchemataProvider { - data: Arc>, -} - -impl TableName for InfoSchemaSchemataProvider { - fn table_name(&self) -> &str { - "information_schema.schemata" - } -} - -impl InfoSchemaSchemataProvider { - pub fn new() -> Self { - let mut builder = InformationSchemaSchemataBuilder::new(); - // information_schema - builder.add_schema("information_schema", "utf8", "utf8_general_ci"); - builder.add_schema("mysql", "utf8mb4", "utf8mb4_0900_ai_ci"); - builder.add_schema("performance_schema", "utf8mb4", "utf8mb4_0900_ai_ci"); - builder.add_schema("sys", "utf8mb4", "utf8mb4_0900_ai_ci"); - builder.add_schema("test", "utf8mb4", "utf8mb4_0900_ai_ci"); - - Self { - data: Arc::new(builder.finish()), - } - } -} - -#[async_trait] -impl TableProvider for InfoSchemaSchemataProvider { - fn as_any(&self) -> &dyn Any { - self - } - - fn table_type(&self) -> TableType { - TableType::View - } - - fn schema(&self) -> SchemaRef { - Arc::new(Schema::new(vec![ - Field::new("CATALOG_NAME", DataType::Utf8, false), - Field::new("SCHEMA_NAME", DataType::Utf8, false), - Field::new("DEFAULT_CHARACTER_SET_NAME", DataType::Utf8, false), - Field::new("DEFAULT_COLLATION_NAME", DataType::Utf8, false), - Field::new("SQL_PATH", DataType::Utf8, true), - Field::new("DEFAULT_ENCRYPTION", DataType::Utf8, false), - ])) - } - - async fn scan( - &self, - projection: &Option>, - _filters: &[Expr], - _limit: Option, - ) -> Result, DataFusionError> { - let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; - - Ok(Arc::new(MemoryExec::try_new( - &[vec![batch]], - self.schema(), - projection.clone(), - )?)) - } - - fn supports_filter_pushdown( - &self, - _filter: &Expr, - ) -> Result { - Ok(TableProviderFilterPushDown::Unsupported) - } -} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/statistics.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/statistics.rs deleted file mode 100644 index 6fa4e99cdf41d..0000000000000 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/statistics.rs +++ /dev/null @@ -1,152 +0,0 @@ -use std::{any::Any, sync::Arc}; - -use async_trait::async_trait; - -use datafusion::{ - arrow::{ - array::{Array, ArrayRef, StringBuilder}, - datatypes::{DataType, Field, Schema, SchemaRef}, - record_batch::RecordBatch, - }, - datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, - error::DataFusionError, - logical_plan::Expr, - physical_plan::{memory::MemoryExec, ExecutionPlan}, -}; - -use super::utils::{new_string_array_with_placeholder, new_uint32_array_with_placeholder}; -use crate::compile::engine::context::TableName; - -struct InformationSchemaStatisticsBuilder { - catalog_names: StringBuilder, - schema_names: StringBuilder, - table_names: StringBuilder, -} - -impl InformationSchemaStatisticsBuilder { - fn new() -> Self { - let capacity = 10; - - Self { - catalog_names: StringBuilder::new(capacity), - schema_names: StringBuilder::new(capacity), - table_names: StringBuilder::new(capacity), - } - } - - fn finish(mut self) -> Vec> { - let mut columns: Vec> = vec![]; - - let catalog_names = self.catalog_names.finish(); - let total = catalog_names.len(); - columns.push(Arc::new(catalog_names)); - columns.push(Arc::new(self.schema_names.finish())); - columns.push(Arc::new(self.table_names.finish())); - - // NON_UNIQUE - columns.push(Arc::new(new_uint32_array_with_placeholder(total, 0))); - // INDEX_SCHEMA - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - // INDEX_NAME - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - // SEQ_IN_INDEX - columns.push(Arc::new(new_uint32_array_with_placeholder(total, 0))); - // COLUMN_NAME - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - // COLLATION - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - // EXPRESSION - columns.push(Arc::new(new_uint32_array_with_placeholder(total, 0))); - - columns - } -} - -pub struct InfoSchemaStatisticsProvider { - data: Arc>, -} - -impl TableName for InfoSchemaStatisticsProvider { - fn table_name(&self) -> &str { - "information_schema.statistics" - } -} - -impl InfoSchemaStatisticsProvider { - pub fn new() -> Self { - let builder = InformationSchemaStatisticsBuilder::new(); - - Self { - data: Arc::new(builder.finish()), - } - } -} - -#[async_trait] -impl TableProvider for InfoSchemaStatisticsProvider { - fn as_any(&self) -> &dyn Any { - self - } - - fn table_type(&self) -> TableType { - TableType::View - } - - fn schema(&self) -> SchemaRef { - Arc::new(Schema::new(vec![ - Field::new("TABLE_CATALOG", DataType::Utf8, false), - Field::new("TABLE_SCHEMA", DataType::Utf8, false), - Field::new("TABLE_NAME", DataType::Utf8, false), - Field::new("NON_UNIQUE", DataType::UInt32, false), - Field::new("INDEX_SCHEMA", DataType::Utf8, false), - Field::new("INDEX_NAME", DataType::Utf8, false), - Field::new("SEQ_IN_INDEX", DataType::UInt32, false), - Field::new("COLUMN_NAME", DataType::Utf8, false), - Field::new("COLLATION", DataType::Utf8, true), - Field::new("CARDINALITY", DataType::UInt32, true), - // @todo - // SUB_PART - // PACKED - // NULLABLE - // INDEX_TYPE - // COMMENT - // INDEX_COMMENT - // IS_VISIBLE - // EXPRESSION - ])) - } - - async fn scan( - &self, - projection: &Option>, - _filters: &[Expr], - _limit: Option, - ) -> Result, DataFusionError> { - let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; - - Ok(Arc::new(MemoryExec::try_new( - &[vec![batch]], - self.schema(), - projection.clone(), - )?)) - } - - fn supports_filter_pushdown( - &self, - _filter: &Expr, - ) -> Result { - Ok(TableProviderFilterPushDown::Unsupported) - } -} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/tables.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/tables.rs deleted file mode 100644 index 3f026206a9906..0000000000000 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/tables.rs +++ /dev/null @@ -1,222 +0,0 @@ -use std::{any::Any, sync::Arc}; - -use crate::{compile::engine::context::TableName, transport::MetaContext}; -use async_trait::async_trait; -use datafusion::{ - arrow::{ - array::{Array, ArrayRef, StringBuilder}, - datatypes::{DataType, Field, Schema, SchemaRef}, - record_batch::RecordBatch, - }, - datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, - error::DataFusionError, - logical_plan::Expr, - physical_plan::{memory::MemoryExec, ExecutionPlan}, -}; - -use super::utils::{new_int64_array_with_placeholder, new_string_array_with_placeholder}; - -struct InformationSchemaTablesBuilder { - catalog_names: StringBuilder, - schema_names: StringBuilder, - table_names: StringBuilder, - table_types: StringBuilder, -} - -impl InformationSchemaTablesBuilder { - fn new() -> Self { - let capacity = 10; - - Self { - catalog_names: StringBuilder::new(capacity), - schema_names: StringBuilder::new(capacity), - table_names: StringBuilder::new(capacity), - table_types: StringBuilder::new(capacity), - } - } - - fn add_table( - &mut self, - catalog_name: impl AsRef, - schema_name: impl AsRef, - table_name: impl AsRef, - ) { - self.catalog_names - .append_value(catalog_name.as_ref()) - .unwrap(); - self.schema_names - .append_value(schema_name.as_ref()) - .unwrap(); - self.table_names.append_value(table_name.as_ref()).unwrap(); - self.table_types - .append_value("BASE TABLE".to_string()) - .unwrap(); - } - - fn finish(mut self) -> Vec> { - let mut columns: Vec> = vec![]; - columns.push(Arc::new(self.catalog_names.finish())); - columns.push(Arc::new(self.schema_names.finish())); - columns.push(Arc::new(self.table_names.finish())); - - let tables_types = self.table_types.finish(); - let total = tables_types.len(); - columns.push(Arc::new(tables_types)); - - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("InnoDB".to_string()), - ))); - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("10".to_string()), - ))); - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("Dynamic".to_string()), - ))); - columns.push(Arc::new(new_int64_array_with_placeholder(total, 0))); - columns.push(Arc::new(new_int64_array_with_placeholder(total, 0))); - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("16384".to_string()), - ))); - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - columns.push(Arc::new(new_string_array_with_placeholder( - total, - Some("".to_string()), - ))); - - columns - } -} - -pub struct InfoSchemaTableProvider { - data: Arc>, -} - -impl TableName for InfoSchemaTableProvider { - fn table_name(&self) -> &str { - "information_schema.tables" - } -} - -impl InfoSchemaTableProvider { - pub fn new(meta: Arc) -> Self { - let mut builder = InformationSchemaTablesBuilder::new(); - // information_schema - builder.add_table("def", "information_schema", "tables"); - builder.add_table("def", "information_schema", "columns"); - builder.add_table("def", "information_schema", "key_column_usage"); - builder.add_table("def", "information_schema", "referential_constraints"); - // performance_schema - builder.add_table("def", "performance_schema", "session_variables"); - builder.add_table("def", "performance_schema", "global_variables"); - - for cube in meta.cubes.iter() { - builder.add_table("def", "db", cube.name.clone()); - } - - Self { - data: Arc::new(builder.finish()), - } - } -} - -#[async_trait] -impl TableProvider for InfoSchemaTableProvider { - fn as_any(&self) -> &dyn Any { - self - } - - fn table_type(&self) -> TableType { - TableType::View - } - - fn schema(&self) -> SchemaRef { - Arc::new(Schema::new(vec![ - Field::new("TABLE_CATALOG", DataType::Utf8, false), - Field::new("TABLE_SCHEMA", DataType::Utf8, false), - Field::new("TABLE_NAME", DataType::Utf8, false), - Field::new("TABLE_TYPE", DataType::Utf8, false), - Field::new("ENGINE", DataType::Utf8, false), - Field::new("VERSION", DataType::Utf8, false), - Field::new("ROW_FORMAT", DataType::Utf8, false), - Field::new("TABLES_ROWS", DataType::Int64, true), - Field::new("AVG_ROW_LENGTH", DataType::Int64, false), - Field::new("DATA_LENGTH", DataType::Utf8, false), - Field::new("MAX_DATA_LENGTH", DataType::Utf8, false), - Field::new("INDEX_LENGTH", DataType::Utf8, false), - Field::new("DATA_FREE", DataType::Utf8, false), - Field::new("AUTO_INCREMENT", DataType::Utf8, true), - Field::new("CREATE_TIME", DataType::Utf8, false), - Field::new("UPDATE_TIME", DataType::Utf8, true), - Field::new("CHECK_TIME", DataType::Utf8, true), - Field::new("TABLE_COLLATION", DataType::Utf8, false), - Field::new("CHECKSUM", DataType::Utf8, true), - Field::new("CREATE_OPTIONS", DataType::Utf8, false), - Field::new("TABLE_COMMENT", DataType::Utf8, false), - ])) - } - - async fn scan( - &self, - projection: &Option>, - _filters: &[Expr], - _limit: Option, - ) -> Result, DataFusionError> { - let batch = RecordBatch::try_new(self.schema(), self.data.to_vec())?; - - Ok(Arc::new(MemoryExec::try_new( - &[vec![batch]], - self.schema(), - projection.clone(), - )?)) - } - - fn supports_filter_pushdown( - &self, - _filter: &Expr, - ) -> Result { - Ok(TableProviderFilterPushDown::Unsupported) - } -} diff --git a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/variables.rs b/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/variables.rs deleted file mode 100644 index d18744914575e..0000000000000 --- a/rust/cubesql/cubesql/src/compile/engine/information_schema/mysql/variables.rs +++ /dev/null @@ -1,85 +0,0 @@ -use std::{any::Any, sync::Arc}; - -use crate::compile::{engine::context::TableName, DatabaseVariables}; -use async_trait::async_trait; -use datafusion::{ - arrow::{ - array::{Array, StringBuilder}, - datatypes::{DataType, Field, Schema, SchemaRef}, - record_batch::RecordBatch, - }, - datasource::{datasource::TableProviderFilterPushDown, TableProvider, TableType}, - error::DataFusionError, - logical_plan::Expr, - physical_plan::{memory::MemoryExec, ExecutionPlan}, -}; - -pub struct PerfSchemaVariablesProvider { - table_name: String, - variables: DatabaseVariables, -} - -impl TableName for PerfSchemaVariablesProvider { - fn table_name(&self) -> &str { - &self.table_name - } -} - -impl PerfSchemaVariablesProvider { - pub fn new(table_name: String, vars: DatabaseVariables) -> Self { - Self { - table_name, - variables: vars, - } - } -} - -#[async_trait] -impl TableProvider for PerfSchemaVariablesProvider { - fn as_any(&self) -> &dyn Any { - self - } - - fn table_type(&self) -> TableType { - TableType::View - } - - fn schema(&self) -> SchemaRef { - Arc::new(Schema::new(vec![ - Field::new("VARIABLE_NAME", DataType::Utf8, false), - Field::new("VARIABLE_VALUE", DataType::Utf8, false), - ])) - } - - async fn scan( - &self, - projection: &Option>, - _filters: &[Expr], - _limit: Option, - ) -> Result, DataFusionError> { - let mut names = StringBuilder::new(100); - let mut values = StringBuilder::new(100); - - for (key, variable) in self.variables.iter() { - names.append_value(key.clone()).unwrap(); - values.append_value(variable.value.to_string()).unwrap(); - } - - let data: Vec> = vec![Arc::new(names.finish()), Arc::new(values.finish())]; - - let batch = RecordBatch::try_new(self.schema(), data)?; - - Ok(Arc::new(MemoryExec::try_new( - &[vec![batch]], - self.schema(), - projection.clone(), - )?)) - } - - fn supports_filter_pushdown( - &self, - _filter: &Expr, - ) -> Result { - Ok(TableProviderFilterPushDown::Unsupported) - } -} diff --git a/rust/cubesql/cubesql/src/compile/mod.rs b/rust/cubesql/cubesql/src/compile/mod.rs index fd86bf2f21b47..b901a89a1dbe5 100644 --- a/rust/cubesql/cubesql/src/compile/mod.rs +++ b/rust/cubesql/cubesql/src/compile/mod.rs @@ -4125,20 +4125,6 @@ limit check_subs_to("2021-03-29 00:00:00", "1 month", "2021-02-28T00:00:00.000").await; } - #[tokio::test] - async fn test_information_schema_tables_mysql() -> Result<(), CubeError> { - insta::assert_snapshot!( - "information_schema_tables_mysql", - execute_query( - "SELECT * FROM information_schema.tables".to_string(), - DatabaseProtocol::MySQL - ) - .await? - ); - - Ok(()) - } - #[tokio::test] async fn test_information_role_table_grants_pg() -> Result<(), CubeError> { insta::assert_snapshot!( @@ -4189,50 +4175,6 @@ limit Ok(()) } - #[tokio::test] - async fn test_information_schema_columns_mysql() -> Result<(), CubeError> { - insta::assert_snapshot!( - "information_schema_columns_mysql", - execute_query( - "SELECT * FROM information_schema.columns WHERE TABLE_SCHEMA = 'db'".to_string(), - DatabaseProtocol::MySQL - ) - .await? - ); - - Ok(()) - } - - #[tokio::test] - async fn test_information_schema_schemata() -> Result<(), CubeError> { - insta::assert_snapshot!( - "information_schema_schemata", - execute_query( - "SELECT * FROM information_schema.schemata".to_string(), - DatabaseProtocol::MySQL - ) - .await? - ); - - Ok(()) - } - - #[tokio::test] - async fn test_information_schema_stats_for_columns() -> Result<(), CubeError> { - // This query is used by metabase for introspection - insta::assert_snapshot!( - "test_information_schema_stats_for_columns", - execute_query(" - SELECT - A.TABLE_SCHEMA TABLE_CAT, NULL TABLE_SCHEM, A.TABLE_NAME, A.COLUMN_NAME, B.SEQ_IN_INDEX KEY_SEQ, B.INDEX_NAME PK_NAME - FROM INFORMATION_SCHEMA.COLUMNS A, INFORMATION_SCHEMA.STATISTICS B - WHERE A.COLUMN_KEY in ('PRI','pri') AND B.INDEX_NAME='PRIMARY' AND (ISNULL(database()) OR (A.TABLE_SCHEMA = database())) AND (ISNULL(database()) OR (B.TABLE_SCHEMA = database())) AND A.TABLE_NAME = 'OutlierFingerprints' AND B.TABLE_NAME = 'OutlierFingerprints' AND A.TABLE_SCHEMA = B.TABLE_SCHEMA AND A.TABLE_NAME = B.TABLE_NAME AND A.COLUMN_NAME = B.COLUMN_NAME - ORDER BY A.COLUMN_NAME".to_string(), DatabaseProtocol::MySQL).await? - ); - - Ok(()) - } - #[tokio::test] async fn test_redshift_svv_tables() -> Result<(), CubeError> { // This query is used by metabase for introspection @@ -5057,85 +4999,6 @@ ORDER BY Ok(()) } - #[tokio::test] - async fn test_performance_schema_variables() -> Result<(), CubeError> { - insta::assert_snapshot!( - "performance_schema_session_variables", - execute_query("SELECT * FROM performance_schema.session_variables WHERE VARIABLE_NAME = 'max_allowed_packet'".to_string(), DatabaseProtocol::MySQL).await? - ); - - insta::assert_snapshot!( - "performance_schema_global_variables", - execute_query("SELECT * FROM performance_schema.global_variables WHERE VARIABLE_NAME = 'max_allowed_packet'".to_string(), DatabaseProtocol::MySQL).await? - ); - - Ok(()) - } - - #[tokio::test] - async fn test_information_schema_collations() -> Result<(), CubeError> { - insta::assert_snapshot!( - "information_schema_collations", - execute_query( - "SELECT * FROM information_schema.collations".to_string(), - DatabaseProtocol::MySQL - ) - .await? - ); - - Ok(()) - } - - #[tokio::test] - async fn test_information_processlist() -> Result<(), CubeError> { - insta::assert_snapshot!( - "information_schema_processlist", - execute_query( - "SELECT * FROM information_schema.processlist".to_string(), - DatabaseProtocol::MySQL - ) - .await? - ); - - Ok(()) - } - - #[tokio::test] - async fn test_gdata_studio() -> Result<(), CubeError> { - insta::assert_snapshot!( - "test_gdata_studio", - execute_query( - // This query I saw in Google Data Studio - "/* mysql-connector-java-5.1.49 ( Revision: ad86f36e100e104cd926c6b81c8cab9565750116 ) */ - SELECT \ - @@session.auto_increment_increment AS auto_increment_increment, \ - @@character_set_client AS character_set_client, \ - @@character_set_connection AS character_set_connection, \ - @@character_set_results AS character_set_results, \ - @@character_set_server AS character_set_server, \ - @@collation_server AS collation_server, \ - @@collation_connection AS collation_connection, \ - @@init_connect AS init_connect, \ - @@interactive_timeout AS interactive_timeout, \ - @@license AS license, \ - @@lower_case_table_names AS lower_case_table_names, \ - @@max_allowed_packet AS max_allowed_packet, \ - @@net_buffer_length AS net_buffer_length, \ - @@net_write_timeout AS net_write_timeout, \ - @@sql_mode AS sql_mode, \ - @@system_time_zone AS system_time_zone, \ - @@time_zone AS time_zone, \ - @@transaction_isolation AS transaction_isolation, \ - @@wait_timeout AS wait_timeout - " - .to_string(), DatabaseProtocol::MySQL - ) - .await? - ); - - Ok(()) - } - #[tokio::test] async fn test_show_variable() -> Result<(), CubeError> { // Postgres escaped with quotes diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__information_schema_collations.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__information_schema_collations.snap deleted file mode 100644 index 10583881e35a8..0000000000000 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__information_schema_collations.snap +++ /dev/null @@ -1,85 +0,0 @@ ---- -source: cubesql/src/compile/mod.rs -assertion_line: 4111 -expression: "execute_query(\"SELECT * FROM information_schema.collations\".to_string()).await?" - ---- -+----------------------------+--------------------+-----+------------+-------------+---------+---------------+ -| COLLATION_NAME | CHARACTER_SET_NAME | ID | IS_DEFAULT | IS_COMPILED | SORTLEN | PAD_ATTRIBUTE | -+----------------------------+--------------------+-----+------------+-------------+---------+---------------+ -| utf8mb4_general_ci | utf8mb4 | 45 | | Yes | 1 | PAD SPACE | -| utf8mb4_bin | utf8mb4 | 46 | | Yes | 1 | PAD SPACE | -| utf8mb4_unicode_ci | utf8mb4 | 224 | | Yes | 8 | PAD SPACE | -| utf8mb4_icelandic_ci | utf8mb4 | 225 | | Yes | 8 | PAD SPACE | -| utf8mb4_latvian_ci | utf8mb4 | 226 | | Yes | 8 | PAD SPACE | -| utf8mb4_romanian_ci | utf8mb4 | 227 | | Yes | 8 | PAD SPACE | -| utf8mb4_slovenian_ci | utf8mb4 | 228 | | Yes | 8 | PAD SPACE | -| utf8mb4_polish_ci | utf8mb4 | 229 | | Yes | 8 | PAD SPACE | -| utf8mb4_estonian_ci | utf8mb4 | 230 | | Yes | 8 | PAD SPACE | -| utf8mb4_spanish_ci | utf8mb4 | 231 | | Yes | 8 | PAD SPACE | -| utf8mb4_swedish_ci | utf8mb4 | 232 | | Yes | 8 | PAD SPACE | -| utf8mb4_turkish_ci | utf8mb4 | 233 | | Yes | 8 | PAD SPACE | -| utf8mb4_czech_ci | utf8mb4 | 234 | | Yes | 8 | PAD SPACE | -| utf8mb4_danish_ci | utf8mb4 | 235 | | Yes | 8 | PAD SPACE | -| utf8mb4_lithuanian_ci | utf8mb4 | 236 | | Yes | 8 | PAD SPACE | -| utf8mb4_slovak_ci | utf8mb4 | 237 | | Yes | 8 | PAD SPACE | -| utf8mb4_spanish2_ci | utf8mb4 | 238 | | Yes | 8 | PAD SPACE | -| utf8mb4_roman_ci | utf8mb4 | 239 | | Yes | 8 | PAD SPACE | -| utf8mb4_persian_ci | utf8mb4 | 240 | | Yes | 8 | PAD SPACE | -| utf8mb4_esperanto_ci | utf8mb4 | 241 | | Yes | 8 | PAD SPACE | -| utf8mb4_hungarian_ci | utf8mb4 | 242 | | Yes | 8 | PAD SPACE | -| utf8mb4_sinhala_ci | utf8mb4 | 243 | | Yes | 8 | PAD SPACE | -| utf8mb4_german2_ci | utf8mb4 | 244 | | Yes | 8 | PAD SPACE | -| utf8mb4_croatian_ci | utf8mb4 | 245 | | Yes | 8 | PAD SPACE | -| utf8mb4_unicode_520_ci | utf8mb4 | 246 | | Yes | 8 | PAD SPACE | -| utf8mb4_vietnamese_ci | utf8mb4 | 247 | | Yes | 8 | PAD SPACE | -| utf8mb4_0900_ai_ci | utf8mb4 | 255 | Yes | Yes | 0 | NO PAD | -| utf8mb4_de_pb_0900_ai_ci | utf8mb4 | 256 | | Yes | 0 | NO PAD | -| utf8mb4_is_0900_ai_ci | utf8mb4 | 257 | | Yes | 0 | NO PAD | -| utf8mb4_lv_0900_ai_ci | utf8mb4 | 258 | | Yes | 0 | NO PAD | -| utf8mb4_ro_0900_ai_ci | utf8mb4 | 259 | | Yes | 0 | NO PAD | -| utf8mb4_sl_0900_ai_ci | utf8mb4 | 260 | | Yes | 0 | NO PAD | -| utf8mb4_pl_0900_ai_ci | utf8mb4 | 261 | | Yes | 0 | NO PAD | -| utf8mb4_et_0900_ai_ci | utf8mb4 | 262 | | Yes | 0 | NO PAD | -| utf8mb4_es_0900_ai_ci | utf8mb4 | 263 | | Yes | 0 | NO PAD | -| utf8mb4_sv_0900_ai_ci | utf8mb4 | 264 | | Yes | 0 | NO PAD | -| utf8mb4_tr_0900_ai_ci | utf8mb4 | 265 | | Yes | 0 | NO PAD | -| utf8mb4_cs_0900_ai_ci | utf8mb4 | 266 | | Yes | 0 | NO PAD | -| utf8mb4_da_0900_ai_ci | utf8mb4 | 267 | | Yes | 0 | NO PAD | -| utf8mb4_lt_0900_ai_ci | utf8mb4 | 268 | | Yes | 0 | NO PAD | -| utf8mb4_sk_0900_ai_ci | utf8mb4 | 269 | | Yes | 0 | NO PAD | -| utf8mb4_es_trad_0900_ai_ci | utf8mb4 | 270 | | Yes | 0 | NO PAD | -| utf8mb4_la_0900_ai_ci | utf8mb4 | 271 | | Yes | 0 | NO PAD | -| utf8mb4_eo_0900_ai_ci | utf8mb4 | 273 | | Yes | 0 | NO PAD | -| utf8mb4_hu_0900_ai_ci | utf8mb4 | 274 | | Yes | 0 | NO PAD | -| utf8mb4_hr_0900_ai_ci | utf8mb4 | 275 | | Yes | 0 | NO PAD | -| utf8mb4_vi_0900_ai_ci | utf8mb4 | 277 | | Yes | 0 | NO PAD | -| utf8mb4_0900_as_cs | utf8mb4 | 278 | | Yes | 0 | NO PAD | -| utf8mb4_de_pb_0900_as_cs | utf8mb4 | 279 | | Yes | 0 | NO PAD | -| utf8mb4_is_0900_as_cs | utf8mb4 | 280 | | Yes | 0 | NO PAD | -| utf8mb4_lv_0900_as_cs | utf8mb4 | 281 | | Yes | 0 | NO PAD | -| utf8mb4_ro_0900_as_cs | utf8mb4 | 282 | | Yes | 0 | NO PAD | -| utf8mb4_sl_0900_as_cs | utf8mb4 | 283 | | Yes | 0 | NO PAD | -| utf8mb4_pl_0900_as_cs | utf8mb4 | 284 | | Yes | 0 | NO PAD | -| utf8mb4_et_0900_as_cs | utf8mb4 | 285 | | Yes | 0 | NO PAD | -| utf8mb4_es_0900_as_cs | utf8mb4 | 286 | | Yes | 0 | NO PAD | -| utf8mb4_sv_0900_as_cs | utf8mb4 | 287 | | Yes | 0 | NO PAD | -| utf8mb4_tr_0900_as_cs | utf8mb4 | 288 | | Yes | 0 | NO PAD | -| utf8mb4_cs_0900_as_cs | utf8mb4 | 289 | | Yes | 0 | NO PAD | -| utf8mb4_da_0900_as_cs | utf8mb4 | 290 | | Yes | 0 | NO PAD | -| utf8mb4_lt_0900_as_cs | utf8mb4 | 291 | | Yes | 0 | NO PAD | -| utf8mb4_sk_0900_as_cs | utf8mb4 | 292 | | Yes | 0 | NO PAD | -| utf8mb4_es_trad_0900_as_cs | utf8mb4 | 293 | | Yes | 0 | NO PAD | -| utf8mb4_la_0900_as_cs | utf8mb4 | 294 | | Yes | 0 | NO PAD | -| utf8mb4_eo_0900_as_cs | utf8mb4 | 296 | | Yes | 0 | NO PAD | -| utf8mb4_hu_0900_as_cs | utf8mb4 | 297 | | Yes | 0 | NO PAD | -| utf8mb4_hr_0900_as_cs | utf8mb4 | 298 | | Yes | 0 | NO PAD | -| utf8mb4_vi_0900_as_cs | utf8mb4 | 300 | | Yes | 0 | NO PAD | -| utf8mb4_ja_0900_as_cs | utf8mb4 | 303 | | Yes | 0 | NO PAD | -| utf8mb4_ja_0900_as_cs_ks | utf8mb4 | 304 | | Yes | 24 | NO PAD | -| utf8mb4_0900_as_ci | utf8mb4 | 305 | | Yes | 0 | NO PAD | -| utf8mb4_ru_0900_ai_ci | utf8mb4 | 306 | | Yes | 0 | NO PAD | -| utf8mb4_ru_0900_as_cs | utf8mb4 | 307 | | Yes | 0 | NO PAD | -| utf8mb4_zh_0900_as_cs | utf8mb4 | 308 | | Yes | 0 | NO PAD | -| utf8mb4_0900_bin | utf8mb4 | 309 | | Yes | 1 | NO PAD | -+----------------------------+--------------------+-----+------------+-------------+---------+---------------+ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__information_schema_columns_mysql.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__information_schema_columns_mysql.snap deleted file mode 100644 index 679717bec9a77..0000000000000 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__information_schema_columns_mysql.snap +++ /dev/null @@ -1,309 +0,0 @@ ---- -source: cubesql/src/compile/mod.rs -expression: "execute_query(\"SELECT * FROM information_schema.columns WHERE TABLE_SCHEMA = 'db'\".to_string(),\nDatabaseProtocol::MySQL).await?" ---- -+---------------+--------------+---------------------------+--------------------+------------------+----------------+-------------+------------+--------------------------+------------------------+--------------+-------------------+---------------+--------------------+------------+-------+----------------+-----------------------+--------+ -| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | ORDINAL_POSITION | COLUMN_DEFAULT | IS_NULLABLE | DATA_TYPE | CHARACTER_MAXIMUM_LENGTH | CHARACTER_OCTET_LENGTH | COLUMN_TYPE | NUMERIC_PRECISION | NUMERIC_SCALE | DATETIME_PRECISION | COLUMN_KEY | EXTRA | COLUMN_COMMENT | GENERATION_EXPRESSION | SRS_ID | -+---------------+--------------+---------------------------+--------------------+------------------+----------------+-------------+------------+--------------------------+------------------------+--------------+-------------------+---------------+--------------------+------------+-------+----------------+-----------------------+--------+ -| def | db | KibanaSampleDataEcommerce | count | 0 | | NO | int | NULL | NULL | int | NULL | NULL | NULL | | | | | | -| def | db | KibanaSampleDataEcommerce | maxPrice | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | KibanaSampleDataEcommerce | sumPrice | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | KibanaSampleDataEcommerce | minPrice | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | KibanaSampleDataEcommerce | avgPrice | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | KibanaSampleDataEcommerce | countDistinct | 0 | | NO | int | NULL | NULL | int | NULL | NULL | NULL | | | | | | -| def | db | KibanaSampleDataEcommerce | id | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | KibanaSampleDataEcommerce | order_date | 0 | | YES | datetime | NULL | NULL | datetime | NULL | NULL | NULL | | | | | | -| def | db | KibanaSampleDataEcommerce | last_mod | 0 | | YES | datetime | NULL | NULL | datetime | NULL | NULL | NULL | | | | | | -| def | db | KibanaSampleDataEcommerce | customer_gender | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | KibanaSampleDataEcommerce | notes | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | KibanaSampleDataEcommerce | taxful_total_price | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | KibanaSampleDataEcommerce | has_subscription | 0 | | YES | tinyint(1) | NULL | NULL | tinyint(1) | NULL | NULL | NULL | | | | | | -| def | db | KibanaSampleDataEcommerce | is_male | 0 | | NO | tinyint(1) | NULL | NULL | tinyint(1) | NULL | NULL | NULL | | | | | | -| def | db | KibanaSampleDataEcommerce | is_female | 0 | | NO | tinyint(1) | NULL | NULL | tinyint(1) | NULL | NULL | NULL | | | | | | -| def | db | KibanaSampleDataEcommerce | __user | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | KibanaSampleDataEcommerce | __cubeJoinField | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | Logs | agentCount | 0 | | NO | int | NULL | NULL | int | NULL | NULL | NULL | | | | | | -| def | db | Logs | agentCountApprox | 0 | | NO | int | NULL | NULL | int | NULL | NULL | NULL | | | | | | -| def | db | Logs | id | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | Logs | read | 0 | | YES | tinyint(1) | NULL | NULL | tinyint(1) | NULL | NULL | NULL | | | | | | -| def | db | Logs | content | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | Logs | __user | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | Logs | __cubeJoinField | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | NumberCube | someNumber | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | NumberCube | __user | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | NumberCube | __cubeJoinField | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure0 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure1 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure2 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure3 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure4 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure5 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure6 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure7 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure8 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure9 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure10 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure11 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure12 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure13 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure14 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure15 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure16 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure17 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure18 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure19 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure20 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure21 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure22 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure23 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure24 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure25 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure26 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure27 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure28 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure29 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure30 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure31 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure32 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure33 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure34 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure35 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure36 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure37 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure38 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure39 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure40 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure41 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure42 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure43 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure44 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure45 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure46 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure47 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure48 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure49 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure50 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure51 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure52 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure53 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure54 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure55 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure56 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure57 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure58 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure59 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure60 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure61 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure62 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure63 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure64 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure65 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure66 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure67 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure68 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure69 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure70 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure71 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure72 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure73 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure74 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure75 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure76 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure77 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure78 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure79 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure80 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure81 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure82 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure83 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure84 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure85 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure86 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure87 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure88 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure89 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure90 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure91 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure92 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure93 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure94 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure95 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure96 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure97 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure98 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | measure99 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | count | 0 | | NO | int | NULL | NULL | int | NULL | NULL | NULL | | | | | | -| def | db | WideCube | maxPrice | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | minPrice | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | avgPrice | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | countDistinct | 0 | | NO | int | NULL | NULL | int | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim0 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim1 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim2 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim3 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim4 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim5 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim6 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim7 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim8 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim9 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim10 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim11 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim12 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim13 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim14 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim15 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim16 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim17 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim18 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim19 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim20 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim21 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim22 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim23 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim24 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim25 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim26 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim27 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim28 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim29 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim30 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim31 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim32 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim33 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim34 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim35 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim36 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim37 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim38 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim39 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim40 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim41 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim42 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim43 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim44 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim45 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim46 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim47 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim48 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim49 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim50 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim51 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim52 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim53 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim54 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim55 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim56 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim57 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim58 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim59 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim60 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim61 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim62 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim63 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim64 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim65 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim66 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim67 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim68 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim69 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim70 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim71 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim72 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim73 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim74 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim75 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim76 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim77 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim78 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim79 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim80 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim81 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim82 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim83 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim84 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim85 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim86 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim87 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim88 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim89 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim90 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim91 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim92 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim93 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim94 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim95 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim96 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim97 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim98 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | dim99 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | WideCube | __user | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | WideCube | __cubeJoinField | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_num0 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_str0 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_date0 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_num1 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_str1 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_date1 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_num2 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_str2 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_date2 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_num3 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_str3 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_date3 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_num4 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_str4 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_date4 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_num5 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_str5 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_date5 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_num6 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_str6 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_date6 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_num7 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_str7 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_date7 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_num8 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_str8 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_date8 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_num9 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_str9 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | measure_date9 | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | count | 0 | | NO | int | NULL | NULL | int | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | maxPrice | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | minPrice | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | avgPrice | 0 | | NO | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | countDistinct | 0 | | NO | int | NULL | NULL | int | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_num0 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_str0 | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_date0 | 0 | | YES | datetime | NULL | NULL | datetime | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_num1 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_str1 | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_date1 | 0 | | YES | datetime | NULL | NULL | datetime | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_num2 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_str2 | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_date2 | 0 | | YES | datetime | NULL | NULL | datetime | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_num3 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_str3 | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_date3 | 0 | | YES | datetime | NULL | NULL | datetime | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_num4 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_str4 | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_date4 | 0 | | YES | datetime | NULL | NULL | datetime | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_num5 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_str5 | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_date5 | 0 | | YES | datetime | NULL | NULL | datetime | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_num6 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_str6 | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_date6 | 0 | | YES | datetime | NULL | NULL | datetime | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_num7 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_str7 | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_date7 | 0 | | YES | datetime | NULL | NULL | datetime | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_num8 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_str8 | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_date8 | 0 | | YES | datetime | NULL | NULL | datetime | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_num9 | 0 | | YES | numeric | NULL | NULL | numeric | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_str9 | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | dim_date9 | 0 | | YES | datetime | NULL | NULL | datetime | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | __user | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -| def | db | MultiTypeCube | __cubeJoinField | 0 | | YES | varchar | NULL | NULL | varchar(255) | NULL | NULL | NULL | | | | | | -+---------------+--------------+---------------------------+--------------------+------------------+----------------+-------------+------------+--------------------------+------------------------+--------------+-------------------+---------------+--------------------+------------+-------+----------------+-----------------------+--------+ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__information_schema_processlist.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__information_schema_processlist.snap deleted file mode 100644 index 21106bd1ad2c9..0000000000000 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__information_schema_processlist.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: cubesql/src/compile/mod.rs -assertion_line: 5710 -expression: "execute_query(\"SELECT * FROM information_schema.processlist\".to_string(),\n DatabaseProtocol::MySQL).await?" ---- -+----+------+-----------+----+---------+------+------------------------+------+ -| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO | -+----+------+-----------+----+---------+------+------------------------+------+ -| 1 | ovr | 127.0.0.1 | db | daemon | 0 | Waiting on empty queue | NULL | -+----+------+-----------+----+---------+------+------------------------+------+ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__information_schema_schemata.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__information_schema_schemata.snap deleted file mode 100644 index a3636c18cf9e2..0000000000000 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__information_schema_schemata.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: cubesql/src/compile/mod.rs -assertion_line: 3825 -expression: "execute_query(\"SELECT * FROM information_schema.schemata\".to_string()).await?" - ---- -+--------------+--------------------+----------------------------+------------------------+----------+--------------------+ -| CATALOG_NAME | SCHEMA_NAME | DEFAULT_CHARACTER_SET_NAME | DEFAULT_COLLATION_NAME | SQL_PATH | DEFAULT_ENCRYPTION | -+--------------+--------------------+----------------------------+------------------------+----------+--------------------+ -| def | information_schema | utf8 | utf8_general_ci | NULL | NO | -| def | mysql | utf8mb4 | utf8mb4_0900_ai_ci | NULL | NO | -| def | performance_schema | utf8mb4 | utf8mb4_0900_ai_ci | NULL | NO | -| def | sys | utf8mb4 | utf8mb4_0900_ai_ci | NULL | NO | -| def | test | utf8mb4 | utf8mb4_0900_ai_ci | NULL | NO | -+--------------+--------------------+----------------------------+------------------------+----------+--------------------+ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__information_schema_tables_mysql.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__information_schema_tables_mysql.snap deleted file mode 100644 index 7b24b69a735d9..0000000000000 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__information_schema_tables_mysql.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: cubesql/src/compile/mod.rs -assertion_line: 6520 -expression: "execute_query(\"SELECT * FROM information_schema.tables\".to_string(),\n DatabaseProtocol::MySQL).await?" ---- -+---------------+--------------------+---------------------------+------------+--------+---------+------------+-------------+----------------+-------------+-----------------+--------------+-----------+----------------+-------------+-------------+------------+-----------------+----------+----------------+---------------+ -| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | TABLE_TYPE | ENGINE | VERSION | ROW_FORMAT | TABLES_ROWS | AVG_ROW_LENGTH | DATA_LENGTH | MAX_DATA_LENGTH | INDEX_LENGTH | DATA_FREE | AUTO_INCREMENT | CREATE_TIME | UPDATE_TIME | CHECK_TIME | TABLE_COLLATION | CHECKSUM | CREATE_OPTIONS | TABLE_COMMENT | -+---------------+--------------------+---------------------------+------------+--------+---------+------------+-------------+----------------+-------------+-----------------+--------------+-----------+----------------+-------------+-------------+------------+-----------------+----------+----------------+---------------+ -| def | information_schema | tables | BASE TABLE | InnoDB | 10 | Dynamic | 0 | 0 | 16384 | | | | | | | | | | | | -| def | information_schema | columns | BASE TABLE | InnoDB | 10 | Dynamic | 0 | 0 | 16384 | | | | | | | | | | | | -| def | information_schema | key_column_usage | BASE TABLE | InnoDB | 10 | Dynamic | 0 | 0 | 16384 | | | | | | | | | | | | -| def | information_schema | referential_constraints | BASE TABLE | InnoDB | 10 | Dynamic | 0 | 0 | 16384 | | | | | | | | | | | | -| def | performance_schema | session_variables | BASE TABLE | InnoDB | 10 | Dynamic | 0 | 0 | 16384 | | | | | | | | | | | | -| def | performance_schema | global_variables | BASE TABLE | InnoDB | 10 | Dynamic | 0 | 0 | 16384 | | | | | | | | | | | | -| def | db | KibanaSampleDataEcommerce | BASE TABLE | InnoDB | 10 | Dynamic | 0 | 0 | 16384 | | | | | | | | | | | | -| def | db | Logs | BASE TABLE | InnoDB | 10 | Dynamic | 0 | 0 | 16384 | | | | | | | | | | | | -| def | db | NumberCube | BASE TABLE | InnoDB | 10 | Dynamic | 0 | 0 | 16384 | | | | | | | | | | | | -| def | db | WideCube | BASE TABLE | InnoDB | 10 | Dynamic | 0 | 0 | 16384 | | | | | | | | | | | | -| def | db | MultiTypeCube | BASE TABLE | InnoDB | 10 | Dynamic | 0 | 0 | 16384 | | | | | | | | | | | | -+---------------+--------------------+---------------------------+------------+--------+---------+------------+-------------+----------------+-------------+-----------------+--------------+-----------+----------------+-------------+-------------+------------+-----------------+----------+----------------+---------------+ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__performance_schema_global_variables.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__performance_schema_global_variables.snap deleted file mode 100644 index fc2af0c20eee9..0000000000000 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__performance_schema_global_variables.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: cubesql/src/compile/mod.rs -assertion_line: 3856 -expression: "execute_query(\"SELECT * FROM performance_schema.global_variables WHERE VARIABLE_NAME = 'max_allowed_packet'\".to_string()).await?" - ---- -+--------------------+----------------+ -| VARIABLE_NAME | VARIABLE_VALUE | -+--------------------+----------------+ -| max_allowed_packet | 67108864 | -+--------------------+----------------+ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__performance_schema_session_variables.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__performance_schema_session_variables.snap deleted file mode 100644 index 323d04b080d1a..0000000000000 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__performance_schema_session_variables.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -source: cubesql/src/compile/mod.rs -assertion_line: 3851 -expression: "execute_query(\"SELECT * FROM performance_schema.session_variables WHERE VARIABLE_NAME = 'max_allowed_packet'\".to_string()).await?" - ---- -+--------------------+----------------+ -| VARIABLE_NAME | VARIABLE_VALUE | -+--------------------+----------------+ -| max_allowed_packet | 67108864 | -+--------------------+----------------+ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__test_gdata_studio.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__test_gdata_studio.snap deleted file mode 100644 index 4b161535bf483..0000000000000 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__test_gdata_studio.snap +++ /dev/null @@ -1,9 +0,0 @@ ---- -source: cubesql/src/compile/mod.rs -expression: "execute_query(\"/* mysql-connector-java-5.1.49 ( Revision: ad86f36e100e104cd926c6b81c8cab9565750116 ) */\n SELECT \\\n @@session.auto_increment_increment AS auto_increment_increment, \\\n @@character_set_client AS character_set_client, \\\n @@character_set_connection AS character_set_connection, \\\n @@character_set_results AS character_set_results, \\\n @@character_set_server AS character_set_server, \\\n @@collation_server AS collation_server, \\\n @@collation_connection AS collation_connection, \\\n @@init_connect AS init_connect, \\\n @@interactive_timeout AS interactive_timeout, \\\n @@license AS license, \\\n @@lower_case_table_names AS lower_case_table_names, \\\n @@max_allowed_packet AS max_allowed_packet, \\\n @@net_buffer_length AS net_buffer_length, \\\n @@net_write_timeout AS net_write_timeout, \\\n @@sql_mode AS sql_mode, \\\n @@system_time_zone AS system_time_zone, \\\n @@time_zone AS time_zone, \\\n @@transaction_isolation AS transaction_isolation, \\\n @@wait_timeout AS wait_timeout\n \".to_string(),\n DatabaseProtocol::MySQL).await?" ---- -+--------------------------+----------------------+--------------------------+-----------------------+----------------------+--------------------+----------------------+--------------+---------------------+----------+------------------------+--------------------+-------------------+-------------------+-----------------------------------------------------------------------------------------------------------------------+------------------+-----------+-----------------------+--------------+ -| auto_increment_increment | character_set_client | character_set_connection | character_set_results | character_set_server | collation_server | collation_connection | init_connect | interactive_timeout | license | lower_case_table_names | max_allowed_packet | net_buffer_length | net_write_timeout | sql_mode | system_time_zone | time_zone | transaction_isolation | wait_timeout | -+--------------------------+----------------------+--------------------------+-----------------------+----------------------+--------------------+----------------------+--------------+---------------------+----------+------------------------+--------------------+-------------------+-------------------+-----------------------------------------------------------------------------------------------------------------------+------------------+-----------+-----------------------+--------------+ -| 1 | utf8mb4 | utf8mb4 | utf8mb4 | utf8mb4 | utf8mb4_0900_ai_ci | utf8mb4_general_ci | | 28800 | Apache 2 | 0 | 67108864 | 16384 | 600 | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION | UTC | SYSTEM | REPEATABLE-READ | 28800 | -+--------------------------+----------------------+--------------------------+-----------------------+----------------------+--------------------+----------------------+--------------+---------------------+----------+------------------------+--------------------+-------------------+-------------------+-----------------------------------------------------------------------------------------------------------------------+------------------+-----------+-----------------------+--------------+ diff --git a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__test_information_schema_stats_for_columns.snap b/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__test_information_schema_stats_for_columns.snap deleted file mode 100644 index 242c333a23055..0000000000000 --- a/rust/cubesql/cubesql/src/compile/snapshots/cubesql__compile__tests__test_information_schema_stats_for_columns.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: cubesql/src/compile/mod.rs -expression: "execute_query(\"\n SELECT\n A.TABLE_SCHEMA TABLE_CAT, NULL TABLE_SCHEM, A.TABLE_NAME, A.COLUMN_NAME, B.SEQ_IN_INDEX KEY_SEQ, B.INDEX_NAME PK_NAME\n FROM INFORMATION_SCHEMA.COLUMNS A, INFORMATION_SCHEMA.STATISTICS B\n WHERE A.COLUMN_KEY in ('PRI','pri') AND B.INDEX_NAME='PRIMARY' AND (ISNULL(database()) OR (A.TABLE_SCHEMA = database())) AND (ISNULL(database()) OR (B.TABLE_SCHEMA = database())) AND A.TABLE_NAME = 'OutlierFingerprints' AND B.TABLE_NAME = 'OutlierFingerprints' AND A.TABLE_SCHEMA = B.TABLE_SCHEMA AND A.TABLE_NAME = B.TABLE_NAME AND A.COLUMN_NAME = B.COLUMN_NAME\n ORDER BY A.COLUMN_NAME\".to_string(),\n DatabaseProtocol::MySQL).await?" ---- -+-----------+-------------+------------+-------------+---------+---------+ -| TABLE_CAT | TABLE_SCHEM | TABLE_NAME | COLUMN_NAME | KEY_SEQ | PK_NAME | -+-----------+-------------+------------+-------------+---------+---------+ -+-----------+-------------+------------+-------------+---------+---------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__metabase-2.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__metabase-2.snap deleted file mode 100644 index 094f86868da68..0000000000000 --- a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__metabase-2.snap +++ /dev/null @@ -1,25 +0,0 @@ ---- -source: cubesql/src/compile/test/test_introspection.rs -expression: "execute_query(\"SELECT \\\n TABLE_SCHEMA TABLE_CAT, NULL TABLE_SCHEM, TABLE_NAME, COLUMN_NAME, \\\n CASE data_type WHEN 'bit' THEN -7 WHEN 'tinyblob' THEN -3 WHEN 'mediumblob' THEN -4 WHEN 'longblob' THEN -4 WHEN 'blob' THEN -4 WHEN 'tinytext' THEN 12 WHEN 'mediumtext' THEN -1 WHEN 'longtext' THEN -1 WHEN 'text' THEN -1 WHEN 'date' THEN 91 WHEN 'datetime' THEN 93 WHEN 'decimal' THEN 3 WHEN 'double' THEN 8 WHEN 'enum' THEN 12 WHEN 'float' THEN 7 WHEN 'int' THEN IF( COLUMN_TYPE like '%unsigned%', 4,4) WHEN 'bigint' THEN -5 WHEN 'mediumint' THEN 4 WHEN 'null' THEN 0 WHEN 'set' THEN 12 WHEN 'smallint' THEN IF( COLUMN_TYPE like '%unsigned%', 5,5) WHEN 'varchar' THEN 12 WHEN 'varbinary' THEN -3 WHEN 'char' THEN 1 WHEN 'binary' THEN -2 WHEN 'time' THEN 92 WHEN 'timestamp' THEN 93 WHEN 'tinyint' THEN IF(COLUMN_TYPE like 'tinyint(1)%',-7,-6) WHEN 'year' THEN 91 ELSE 1111 END DATA_TYPE, IF(COLUMN_TYPE like 'tinyint(1)%', 'BIT', UCASE(IF( COLUMN_TYPE LIKE '%(%)%', CONCAT(SUBSTRING( COLUMN_TYPE,1, LOCATE('(',COLUMN_TYPE) - 1 ), SUBSTRING(COLUMN_TYPE ,1+locate(')', COLUMN_TYPE))), COLUMN_TYPE))) TYPE_NAME, CASE DATA_TYPE WHEN 'time' THEN IF(DATETIME_PRECISION = 0, 10, CAST(11 + DATETIME_PRECISION as signed integer)) WHEN 'date' THEN 10 WHEN 'datetime' THEN IF(DATETIME_PRECISION = 0, 19, CAST(20 + DATETIME_PRECISION as signed integer)) WHEN 'timestamp' THEN IF(DATETIME_PRECISION = 0, 19, CAST(20 + DATETIME_PRECISION as signed integer)) ELSE IF(NUMERIC_PRECISION IS NULL, LEAST(CHARACTER_MAXIMUM_LENGTH,2147483647), NUMERIC_PRECISION) END COLUMN_SIZE, \\\n 65535 BUFFER_LENGTH, \\\n CONVERT (CASE DATA_TYPE WHEN 'year' THEN NUMERIC_SCALE WHEN 'tinyint' THEN 0 ELSE NUMERIC_SCALE END, UNSIGNED INTEGER) DECIMAL_DIGITS, 10 NUM_PREC_RADIX, \\\n IF(IS_NULLABLE = 'yes',1,0) NULLABLE,\n COLUMN_COMMENT REMARKS, \\\n COLUMN_DEFAULT COLUMN_DEF, \\\n 0 SQL_DATA_TYPE, \\\n 0 SQL_DATETIME_SUB, \\\n LEAST(CHARACTER_OCTET_LENGTH,2147483647) CHAR_OCTET_LENGTH, \\\n ORDINAL_POSITION, \\\n IS_NULLABLE, \\\n NULL SCOPE_CATALOG, \\\n NULL SCOPE_SCHEMA, \\\n NULL SCOPE_TABLE, \\\n NULL SOURCE_DATA_TYPE, \\\n IF(EXTRA = 'auto_increment','YES','NO') IS_AUTOINCREMENT, \\\n IF(EXTRA in ('VIRTUAL', 'PERSISTENT', 'VIRTUAL GENERATED', 'STORED GENERATED') ,'YES','NO') IS_GENERATEDCOLUMN \\\n FROM INFORMATION_SCHEMA.COLUMNS WHERE (ISNULL(database()) OR (TABLE_SCHEMA = database())) AND TABLE_NAME = 'KibanaSampleDataEcommerce' \\\n ORDER BY TABLE_CAT, TABLE_SCHEM, TABLE_NAME, ORDINAL_POSITION;\".to_string(),\nDatabaseProtocol::MySQL).await?" ---- -+-----------+-------------+---------------------------+--------------------+-----------+-----------+-------------+---------------+----------------+----------------+----------+---------+------------+---------------+------------------+-------------------+------------------+-------------+---------------+--------------+-------------+------------------+------------------+--------------------+ -| TABLE_CAT | TABLE_SCHEM | TABLE_NAME | COLUMN_NAME | DATA_TYPE | TYPE_NAME | COLUMN_SIZE | BUFFER_LENGTH | DECIMAL_DIGITS | NUM_PREC_RADIX | NULLABLE | REMARKS | COLUMN_DEF | SQL_DATA_TYPE | SQL_DATETIME_SUB | CHAR_OCTET_LENGTH | ORDINAL_POSITION | IS_NULLABLE | SCOPE_CATALOG | SCOPE_SCHEMA | SCOPE_TABLE | SOURCE_DATA_TYPE | IS_AUTOINCREMENT | IS_GENERATEDCOLUMN | -+-----------+-------------+---------------------------+--------------------+-----------+-----------+-------------+---------------+----------------+----------------+----------+---------+------------+---------------+------------------+-------------------+------------------+-------------+---------------+--------------+-------------+------------------+------------------+--------------------+ -| db | NULL | KibanaSampleDataEcommerce | count | 4 | INT | 2147483647 | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | NO | NULL | NULL | NULL | NULL | NO | NO | -| db | NULL | KibanaSampleDataEcommerce | maxPrice | 1111 | NUMERIC | 2147483647 | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | NO | NULL | NULL | NULL | NULL | NO | NO | -| db | NULL | KibanaSampleDataEcommerce | sumPrice | 1111 | NUMERIC | 2147483647 | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | NO | NULL | NULL | NULL | NULL | NO | NO | -| db | NULL | KibanaSampleDataEcommerce | minPrice | 1111 | NUMERIC | 2147483647 | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | NO | NULL | NULL | NULL | NULL | NO | NO | -| db | NULL | KibanaSampleDataEcommerce | avgPrice | 1111 | NUMERIC | 2147483647 | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | NO | NULL | NULL | NULL | NULL | NO | NO | -| db | NULL | KibanaSampleDataEcommerce | countDistinct | 4 | INT | 2147483647 | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | NO | NULL | NULL | NULL | NULL | NO | NO | -| db | NULL | KibanaSampleDataEcommerce | id | 1111 | NUMERIC | 2147483647 | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | YES | NULL | NULL | NULL | NULL | NO | NO | -| db | NULL | KibanaSampleDataEcommerce | order_date | 93 | DATETIME | NULL | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | YES | NULL | NULL | NULL | NULL | NO | NO | -| db | NULL | KibanaSampleDataEcommerce | last_mod | 93 | DATETIME | NULL | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | YES | NULL | NULL | NULL | NULL | NO | NO | -| db | NULL | KibanaSampleDataEcommerce | customer_gender | 12 | VARCHAR | 2147483647 | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | YES | NULL | NULL | NULL | NULL | NO | NO | -| db | NULL | KibanaSampleDataEcommerce | notes | 12 | VARCHAR | 2147483647 | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | YES | NULL | NULL | NULL | NULL | NO | NO | -| db | NULL | KibanaSampleDataEcommerce | taxful_total_price | 1111 | NUMERIC | 2147483647 | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | YES | NULL | NULL | NULL | NULL | NO | NO | -| db | NULL | KibanaSampleDataEcommerce | has_subscription | 1111 | BIT | 2147483647 | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | YES | NULL | NULL | NULL | NULL | NO | NO | -| db | NULL | KibanaSampleDataEcommerce | is_male | 1111 | BIT | 2147483647 | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | NO | NULL | NULL | NULL | NULL | NO | NO | -| db | NULL | KibanaSampleDataEcommerce | is_female | 1111 | BIT | 2147483647 | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | NO | NULL | NULL | NULL | NULL | NO | NO | -| db | NULL | KibanaSampleDataEcommerce | __user | 12 | VARCHAR | 2147483647 | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | YES | NULL | NULL | NULL | NULL | NO | NO | -| db | NULL | KibanaSampleDataEcommerce | __cubeJoinField | 12 | VARCHAR | 2147483647 | 65535 | 0 | 10 | 0 | | | 0 | 0 | 2147483647 | 0 | YES | NULL | NULL | NULL | NULL | NO | NO | -+-----------+-------------+---------------------------+--------------------+-----------+-----------+-------------+---------------+----------------+----------------+----------+---------+------------+---------------+------------------+-------------------+------------------+-------------+---------------+--------------+-------------+------------------+------------------+--------------------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__metabase-3.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__metabase-3.snap deleted file mode 100644 index 041787b77184f..0000000000000 --- a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__metabase-3.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: cubesql/src/compile/test/test_introspection.rs -expression: "execute_query(\"SELECT\n KCU.REFERENCED_TABLE_SCHEMA PKTABLE_CAT,\n NULL PKTABLE_SCHEM,\n KCU.REFERENCED_TABLE_NAME PKTABLE_NAME,\n KCU.REFERENCED_COLUMN_NAME PKCOLUMN_NAME,\n KCU.TABLE_SCHEMA FKTABLE_CAT,\n NULL FKTABLE_SCHEM,\n KCU.TABLE_NAME FKTABLE_NAME,\n KCU.COLUMN_NAME FKCOLUMN_NAME,\n KCU.POSITION_IN_UNIQUE_CONSTRAINT KEY_SEQ,\n CASE update_rule WHEN 'RESTRICT' THEN 1 WHEN 'NO ACTION' THEN 3 WHEN 'CASCADE' THEN 0 WHEN 'SET NULL' THEN 2 WHEN 'SET DEFAULT' THEN 4 END UPDATE_RULE,\n CASE DELETE_RULE WHEN 'RESTRICT' THEN 1 WHEN 'NO ACTION' THEN 3 WHEN 'CASCADE' THEN 0 WHEN 'SET NULL' THEN 2 WHEN 'SET DEFAULT' THEN 4 END DELETE_RULE,\n RC.CONSTRAINT_NAME FK_NAME,\n NULL PK_NAME,\n 7 DEFERRABILITY\n FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU\n INNER JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS RC ON KCU.CONSTRAINT_SCHEMA = RC.CONSTRAINT_SCHEMA AND KCU.CONSTRAINT_NAME = RC.CONSTRAINT_NAME\n WHERE (ISNULL(database()) OR (KCU.TABLE_SCHEMA = database())) AND KCU.TABLE_NAME = 'SlackMessages' ORDER BY PKTABLE_CAT, PKTABLE_SCHEM, PKTABLE_NAME, KEY_SEQ\n \".to_string(),\nDatabaseProtocol::MySQL).await?" ---- -+-------------+---------------+--------------+---------------+-------------+---------------+--------------+---------------+---------+-------------+-------------+---------+---------+---------------+ -| PKTABLE_CAT | PKTABLE_SCHEM | PKTABLE_NAME | PKCOLUMN_NAME | FKTABLE_CAT | FKTABLE_SCHEM | FKTABLE_NAME | FKCOLUMN_NAME | KEY_SEQ | UPDATE_RULE | DELETE_RULE | FK_NAME | PK_NAME | DEFERRABILITY | -+-------------+---------------+--------------+---------------+-------------+---------------+--------------+---------------+---------+-------------+-------------+---------+---------+---------------+ -+-------------+---------------+--------------+---------------+-------------+---------------+--------------+---------------+---------+-------------+-------------+---------+---------+---------------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__metabase.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__metabase.snap deleted file mode 100644 index 0c495233569cb..0000000000000 --- a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__metabase.snap +++ /dev/null @@ -1,9 +0,0 @@ ---- -source: cubesql/src/compile/test/test_introspection.rs -expression: "execute_query(\"SELECT \\\n @@GLOBAL.time_zone AS global_tz, \\\n @@system_time_zone AS system_tz, time_format( timediff( now(), convert_tz(now(), @@GLOBAL.time_zone, '+00:00') ), '%H:%i' ) AS 'offset'\n \".to_string(),\nDatabaseProtocol::MySQL).await?" ---- -+-----------+-----------+--------+ -| global_tz | system_tz | offset | -+-----------+-----------+--------+ -| SYSTEM | UTC | 00:00 | -+-----------+-----------+--------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__tableau_null_text_query.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__tableau_null_text_query.snap deleted file mode 100644 index dfb1b31e9fd9a..0000000000000 --- a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__tableau_null_text_query.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: cubesql/src/compile/test/test_introspection.rs -expression: "execute_query(\"\n SELECT\n NULL::text AS PKTABLE_CAT,\n pkn.nspname AS PKTABLE_SCHEM,\n pkc.relname AS PKTABLE_NAME,\n pka.attname AS PKCOLUMN_NAME,\n NULL::text AS FKTABLE_CAT,\n fkn.nspname AS FKTABLE_SCHEM,\n fkc.relname AS FKTABLE_NAME,\n fka.attname AS FKCOLUMN_NAME,\n pos.n AS KEY_SEQ,\n CASE con.confupdtype\n WHEN 'c' THEN 0\n WHEN 'n' THEN 2\n WHEN 'd' THEN 4\n WHEN 'r' THEN 1\n WHEN 'p' THEN 1\n WHEN 'a' THEN 3\n ELSE NULL\n END AS UPDATE_RULE,\n CASE con.confdeltype\n WHEN 'c' THEN 0\n WHEN 'n' THEN 2\n WHEN 'd' THEN 4\n WHEN 'r' THEN 1\n WHEN 'p' THEN 1\n WHEN 'a' THEN 3\n ELSE NULL\n END AS DELETE_RULE,\n con.conname AS FK_NAME,\n pkic.relname AS PK_NAME,\n CASE\n WHEN con.condeferrable AND con.condeferred THEN 5\n WHEN con.condeferrable THEN 6\n ELSE 7\n END AS DEFERRABILITY\n FROM\n pg_catalog.pg_namespace pkn,\n pg_catalog.pg_class pkc,\n pg_catalog.pg_attribute pka,\n pg_catalog.pg_namespace fkn,\n pg_catalog.pg_class fkc,\n pg_catalog.pg_attribute fka,\n pg_catalog.pg_constraint con,\n pg_catalog.generate_series(1, 32) pos(n),\n pg_catalog.pg_class pkic\n WHERE\n pkn.oid = pkc.relnamespace AND\n pkc.oid = pka.attrelid AND\n pka.attnum = con.confkey[pos.n] AND\n con.confrelid = pkc.oid AND\n fkn.oid = fkc.relnamespace AND\n fkc.oid = fka.attrelid AND\n fka.attnum = con.conkey[pos.n] AND\n con.conrelid = fkc.oid AND\n con.contype = 'f' AND\n (pkic.relkind = 'i' OR pkic.relkind = 'I') AND\n pkic.oid = con.conindid AND\n fkn.nspname = 'public' AND\n fkc.relname = 'payment'\n ORDER BY\n pkn.nspname,\n pkc.relname,\n con.conname,\n pos.n\n ;\n \".to_string(),\nDatabaseProtocol::PostgreSQL).await?" ---- -+-------------+---------------+--------------+---------------+-------------+---------------+--------------+---------------+---------+-------------+-------------+---------+---------+---------------+ -| PKTABLE_CAT | PKTABLE_SCHEM | PKTABLE_NAME | PKCOLUMN_NAME | FKTABLE_CAT | FKTABLE_SCHEM | FKTABLE_NAME | FKCOLUMN_NAME | KEY_SEQ | UPDATE_RULE | DELETE_RULE | FK_NAME | PK_NAME | DEFERRABILITY | -+-------------+---------------+--------------+---------------+-------------+---------------+--------------+---------------+---------+-------------+-------------+---------+---------+---------------+ -+-------------+---------------+--------------+---------------+-------------+---------------+--------------+---------------+---------+-------------+-------------+---------+---------+---------------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__tableau_table_cat_query.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__tableau_table_cat_query.snap deleted file mode 100644 index d913c9f686d4c..0000000000000 --- a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__tableau_table_cat_query.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: cubesql/src/compile/test/test_introspection.rs -expression: "execute_query(\"\n SELECT\n result.TABLE_CAT,\n result.TABLE_SCHEM,\n result.TABLE_NAME,\n result.COLUMN_NAME,\n result.KEY_SEQ,\n result.PK_NAME\n FROM\n (\n SELECT\n NULL AS TABLE_CAT,\n n.nspname AS TABLE_SCHEM,\n ct.relname AS TABLE_NAME,\n a.attname AS COLUMN_NAME,\n (information_schema._pg_expandarray(i.indkey)).n AS KEY_SEQ,\n ci.relname AS PK_NAME,\n information_schema._pg_expandarray(i.indkey) AS KEYS,\n a.attnum AS A_ATTNUM\n FROM pg_catalog.pg_class ct\n JOIN pg_catalog.pg_attribute a ON (ct.oid = a.attrelid)\n JOIN pg_catalog.pg_namespace n ON (ct.relnamespace = n.oid)\n JOIN pg_catalog.pg_index i ON (a.attrelid = i.indrelid)\n JOIN pg_catalog.pg_class ci ON (ci.oid = i.indexrelid)\n WHERE\n true AND\n n.nspname = 'public' AND\n ct.relname = 'payment' AND\n i.indisprimary\n ) result\n where result.A_ATTNUM = (result.KEYS).x\n ORDER BY\n result.table_name,\n result.pk_name,\n result.key_seq;\n \".to_string(),\nDatabaseProtocol::PostgreSQL).await?" ---- -+-----------+-------------+------------+-------------+---------+---------+ -| TABLE_CAT | TABLE_SCHEM | TABLE_NAME | COLUMN_NAME | KEY_SEQ | PK_NAME | -+-----------+-------------+------------+-------------+---------+---------+ -+-----------+-------------+------------+-------------+---------+---------+ diff --git a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__tableau_table_name_column_name_query.snap b/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__tableau_table_name_column_name_query.snap deleted file mode 100644 index fe1be7cc6b24b..0000000000000 --- a/rust/cubesql/cubesql/src/compile/test/snapshots/cubesql__compile__test__test_introspection__tableau_table_name_column_name_query.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: cubesql/src/compile/test/test_introspection.rs -expression: "execute_query(\"SELECT `table_name`, `column_name`\n FROM `information_schema`.`columns`\n WHERE `data_type`='enum' AND `table_schema`='db'\".to_string(),\nDatabaseProtocol::MySQL).await?" ---- -+------------+-------------+ -| TABLE_NAME | COLUMN_NAME | -+------------+-------------+ -+------------+-------------+ diff --git a/rust/cubesql/cubesql/src/compile/test/test_introspection.rs b/rust/cubesql/cubesql/src/compile/test/test_introspection.rs index e8e9fef814750..b6546bb19ee79 100644 --- a/rust/cubesql/cubesql/src/compile/test/test_introspection.rs +++ b/rust/cubesql/cubesql/src/compile/test/test_introspection.rs @@ -6,144 +6,6 @@ use crate::{ CubeError, }; -#[tokio::test] -async fn test_tableau() -> Result<(), CubeError> { - insta::assert_snapshot!( - "tableau_table_name_column_name_query", - execute_query( - "SELECT `table_name`, `column_name` - FROM `information_schema`.`columns` - WHERE `data_type`='enum' AND `table_schema`='db'" - .to_string(), - DatabaseProtocol::MySQL - ) - .await? - ); - - insta::assert_snapshot!( - "tableau_null_text_query", - execute_query( - " - SELECT - NULL::text AS PKTABLE_CAT, - pkn.nspname AS PKTABLE_SCHEM, - pkc.relname AS PKTABLE_NAME, - pka.attname AS PKCOLUMN_NAME, - NULL::text AS FKTABLE_CAT, - fkn.nspname AS FKTABLE_SCHEM, - fkc.relname AS FKTABLE_NAME, - fka.attname AS FKCOLUMN_NAME, - pos.n AS KEY_SEQ, - CASE con.confupdtype - WHEN 'c' THEN 0 - WHEN 'n' THEN 2 - WHEN 'd' THEN 4 - WHEN 'r' THEN 1 - WHEN 'p' THEN 1 - WHEN 'a' THEN 3 - ELSE NULL - END AS UPDATE_RULE, - CASE con.confdeltype - WHEN 'c' THEN 0 - WHEN 'n' THEN 2 - WHEN 'd' THEN 4 - WHEN 'r' THEN 1 - WHEN 'p' THEN 1 - WHEN 'a' THEN 3 - ELSE NULL - END AS DELETE_RULE, - con.conname AS FK_NAME, - pkic.relname AS PK_NAME, - CASE - WHEN con.condeferrable AND con.condeferred THEN 5 - WHEN con.condeferrable THEN 6 - ELSE 7 - END AS DEFERRABILITY - FROM - pg_catalog.pg_namespace pkn, - pg_catalog.pg_class pkc, - pg_catalog.pg_attribute pka, - pg_catalog.pg_namespace fkn, - pg_catalog.pg_class fkc, - pg_catalog.pg_attribute fka, - pg_catalog.pg_constraint con, - pg_catalog.generate_series(1, 32) pos(n), - pg_catalog.pg_class pkic - WHERE - pkn.oid = pkc.relnamespace AND - pkc.oid = pka.attrelid AND - pka.attnum = con.confkey[pos.n] AND - con.confrelid = pkc.oid AND - fkn.oid = fkc.relnamespace AND - fkc.oid = fka.attrelid AND - fka.attnum = con.conkey[pos.n] AND - con.conrelid = fkc.oid AND - con.contype = 'f' AND - (pkic.relkind = 'i' OR pkic.relkind = 'I') AND - pkic.oid = con.conindid AND - fkn.nspname = 'public' AND - fkc.relname = 'payment' - ORDER BY - pkn.nspname, - pkc.relname, - con.conname, - pos.n - ; - " - .to_string(), - DatabaseProtocol::PostgreSQL - ) - .await? - ); - - insta::assert_snapshot!( - "tableau_table_cat_query", - execute_query( - " - SELECT - result.TABLE_CAT, - result.TABLE_SCHEM, - result.TABLE_NAME, - result.COLUMN_NAME, - result.KEY_SEQ, - result.PK_NAME - FROM - ( - SELECT - NULL AS TABLE_CAT, - n.nspname AS TABLE_SCHEM, - ct.relname AS TABLE_NAME, - a.attname AS COLUMN_NAME, - (information_schema._pg_expandarray(i.indkey)).n AS KEY_SEQ, - ci.relname AS PK_NAME, - information_schema._pg_expandarray(i.indkey) AS KEYS, - a.attnum AS A_ATTNUM - FROM pg_catalog.pg_class ct - JOIN pg_catalog.pg_attribute a ON (ct.oid = a.attrelid) - JOIN pg_catalog.pg_namespace n ON (ct.relnamespace = n.oid) - JOIN pg_catalog.pg_index i ON (a.attrelid = i.indrelid) - JOIN pg_catalog.pg_class ci ON (ci.oid = i.indexrelid) - WHERE - true AND - n.nspname = 'public' AND - ct.relname = 'payment' AND - i.indisprimary - ) result - where result.A_ATTNUM = (result.KEYS).x - ORDER BY - result.table_name, - result.pk_name, - result.key_seq; - " - .to_string(), - DatabaseProtocol::PostgreSQL - ) - .await? - ); - - Ok(()) -} - #[tokio::test] async fn test_excel() -> Result<(), CubeError> { insta::assert_snapshot!( @@ -1702,73 +1564,6 @@ async fn pgcli_queries() -> Result<(), CubeError> { Ok(()) } -#[tokio::test] -async fn test_metabase() -> Result<(), CubeError> { - insta::assert_snapshot!( - execute_query( - "SELECT \ - @@GLOBAL.time_zone AS global_tz, \ - @@system_time_zone AS system_tz, time_format( timediff( now(), convert_tz(now(), @@GLOBAL.time_zone, '+00:00') ), '%H:%i' ) AS 'offset' - ".to_string(), DatabaseProtocol::MySQL - ) - .await? - ); - - insta::assert_snapshot!( - execute_query( - "SELECT \ - TABLE_SCHEMA TABLE_CAT, NULL TABLE_SCHEM, TABLE_NAME, COLUMN_NAME, \ - CASE data_type WHEN 'bit' THEN -7 WHEN 'tinyblob' THEN -3 WHEN 'mediumblob' THEN -4 WHEN 'longblob' THEN -4 WHEN 'blob' THEN -4 WHEN 'tinytext' THEN 12 WHEN 'mediumtext' THEN -1 WHEN 'longtext' THEN -1 WHEN 'text' THEN -1 WHEN 'date' THEN 91 WHEN 'datetime' THEN 93 WHEN 'decimal' THEN 3 WHEN 'double' THEN 8 WHEN 'enum' THEN 12 WHEN 'float' THEN 7 WHEN 'int' THEN IF( COLUMN_TYPE like '%unsigned%', 4,4) WHEN 'bigint' THEN -5 WHEN 'mediumint' THEN 4 WHEN 'null' THEN 0 WHEN 'set' THEN 12 WHEN 'smallint' THEN IF( COLUMN_TYPE like '%unsigned%', 5,5) WHEN 'varchar' THEN 12 WHEN 'varbinary' THEN -3 WHEN 'char' THEN 1 WHEN 'binary' THEN -2 WHEN 'time' THEN 92 WHEN 'timestamp' THEN 93 WHEN 'tinyint' THEN IF(COLUMN_TYPE like 'tinyint(1)%',-7,-6) WHEN 'year' THEN 91 ELSE 1111 END DATA_TYPE, IF(COLUMN_TYPE like 'tinyint(1)%', 'BIT', UCASE(IF( COLUMN_TYPE LIKE '%(%)%', CONCAT(SUBSTRING( COLUMN_TYPE,1, LOCATE('(',COLUMN_TYPE) - 1 ), SUBSTRING(COLUMN_TYPE ,1+locate(')', COLUMN_TYPE))), COLUMN_TYPE))) TYPE_NAME, CASE DATA_TYPE WHEN 'time' THEN IF(DATETIME_PRECISION = 0, 10, CAST(11 + DATETIME_PRECISION as signed integer)) WHEN 'date' THEN 10 WHEN 'datetime' THEN IF(DATETIME_PRECISION = 0, 19, CAST(20 + DATETIME_PRECISION as signed integer)) WHEN 'timestamp' THEN IF(DATETIME_PRECISION = 0, 19, CAST(20 + DATETIME_PRECISION as signed integer)) ELSE IF(NUMERIC_PRECISION IS NULL, LEAST(CHARACTER_MAXIMUM_LENGTH,2147483647), NUMERIC_PRECISION) END COLUMN_SIZE, \ - 65535 BUFFER_LENGTH, \ - CONVERT (CASE DATA_TYPE WHEN 'year' THEN NUMERIC_SCALE WHEN 'tinyint' THEN 0 ELSE NUMERIC_SCALE END, UNSIGNED INTEGER) DECIMAL_DIGITS, 10 NUM_PREC_RADIX, \ - IF(IS_NULLABLE = 'yes',1,0) NULLABLE, - COLUMN_COMMENT REMARKS, \ - COLUMN_DEFAULT COLUMN_DEF, \ - 0 SQL_DATA_TYPE, \ - 0 SQL_DATETIME_SUB, \ - LEAST(CHARACTER_OCTET_LENGTH,2147483647) CHAR_OCTET_LENGTH, \ - ORDINAL_POSITION, \ - IS_NULLABLE, \ - NULL SCOPE_CATALOG, \ - NULL SCOPE_SCHEMA, \ - NULL SCOPE_TABLE, \ - NULL SOURCE_DATA_TYPE, \ - IF(EXTRA = 'auto_increment','YES','NO') IS_AUTOINCREMENT, \ - IF(EXTRA in ('VIRTUAL', 'PERSISTENT', 'VIRTUAL GENERATED', 'STORED GENERATED') ,'YES','NO') IS_GENERATEDCOLUMN \ - FROM INFORMATION_SCHEMA.COLUMNS WHERE (ISNULL(database()) OR (TABLE_SCHEMA = database())) AND TABLE_NAME = 'KibanaSampleDataEcommerce' \ - ORDER BY TABLE_CAT, TABLE_SCHEM, TABLE_NAME, ORDINAL_POSITION;".to_string(), DatabaseProtocol::MySQL - ) - .await? - ); - - insta::assert_snapshot!( - execute_query( - "SELECT - KCU.REFERENCED_TABLE_SCHEMA PKTABLE_CAT, - NULL PKTABLE_SCHEM, - KCU.REFERENCED_TABLE_NAME PKTABLE_NAME, - KCU.REFERENCED_COLUMN_NAME PKCOLUMN_NAME, - KCU.TABLE_SCHEMA FKTABLE_CAT, - NULL FKTABLE_SCHEM, - KCU.TABLE_NAME FKTABLE_NAME, - KCU.COLUMN_NAME FKCOLUMN_NAME, - KCU.POSITION_IN_UNIQUE_CONSTRAINT KEY_SEQ, - CASE update_rule WHEN 'RESTRICT' THEN 1 WHEN 'NO ACTION' THEN 3 WHEN 'CASCADE' THEN 0 WHEN 'SET NULL' THEN 2 WHEN 'SET DEFAULT' THEN 4 END UPDATE_RULE, - CASE DELETE_RULE WHEN 'RESTRICT' THEN 1 WHEN 'NO ACTION' THEN 3 WHEN 'CASCADE' THEN 0 WHEN 'SET NULL' THEN 2 WHEN 'SET DEFAULT' THEN 4 END DELETE_RULE, - RC.CONSTRAINT_NAME FK_NAME, - NULL PK_NAME, - 7 DEFERRABILITY - FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU - INNER JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS RC ON KCU.CONSTRAINT_SCHEMA = RC.CONSTRAINT_SCHEMA AND KCU.CONSTRAINT_NAME = RC.CONSTRAINT_NAME - WHERE (ISNULL(database()) OR (KCU.TABLE_SCHEMA = database())) AND KCU.TABLE_NAME = 'SlackMessages' ORDER BY PKTABLE_CAT, PKTABLE_SCHEM, PKTABLE_NAME, KEY_SEQ - ".to_string(), DatabaseProtocol::MySQL - ) - .await? - ); - - Ok(()) -} - #[tokio::test] async fn test_metabase_table_cat_query() -> Result<(), CubeError> { insta::assert_snapshot!(