Details
-
Bug
-
Status: Closed (View Workflow)
-
Trivial
-
Resolution: Done
-
10.3.9
-
None
-
Windows
Description
Some minor issues when using MariaDB's Connect ODBC Table_Type Engine with Microsoft Parallel Data Warehouse (PDW):
table_options: TABNAME
When using a Table Definition such as the following for importing a Table:
USE db_name; |
|
CREATE OR REPLACE TABLE `t_name_connect` |
ENGINE=CONNECT |
TABLE_TYPE=ODBC
|
CONNECTION='dsn_name' |
OPTION_LIST='UseDSN=Yes,User=db_user_name,Password=********' |
TABNAME='db_name.schema_name.table_name'; |
|
CREATE OR REPLACE TABLE t_name_mariadb |
AS
|
SELECT |
*
|
FROM |
t_name_connect;
|
The Query works perfectly (10/10), and I am able to import my tables easily to MariaDB. However, an observed limitation is that in TABNAME option, I can only specify my table as:
- db_name.schema_name.table_name.
- And not [db name].[schema name].[table name], which is common syntax for database / schema / table with spaces in TRANSACT-SQL.
table_options: SRCDEF
With Microsoft PDW, using "SQL Server Native Client 11.0" it is not possible to use SRCDEF table option, as otherwise, we would obtain error:
"SQLNumResultCols: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Cursor support is not an implemented feature for SQL Server Parallel DataWarehousing TDS endpoint".
This limitation could be avoided with first method, but we are not able create table definitions as the following by means of the Table Discovery Process:
CREATE OR REPLACE TABLE `t_SQLServer_Table` |
ENGINE=CONNECT |
TABLE_TYPE=ODBC
|
CONNECTION='dns_name' |
OPTION_LIST='UseDSN=Yes,User=user_name,Password=*****' |
SRCDEF=' |
SELECT
|
*
|
FROM
|
[db_name].[schema_name].[table_name]
|
'; |
Previous Table definition would only work if we specified manually the Column Definitions.
Datetime Field Precission
Another issue is Datetime Precission (CONNECT Data Types), which can also be handled with querys such as:
CREATE OR REPLACE TABLE `t_name_connect` |
(
|
`Col_Name` VARCHAR(255) |
)
|
ENGINE=CONNECT |
TABLE_TYPE=ODBC
|
CONNECTION='dsn_name' |
OPTION_LIST='UseDSN=Yes,User=user_name,Password=******' |
TABNAME='db_name.sch_namel.tb_name'; |
|
CREATE OR REPLACE TABLE t_name_mariadb |
AS
|
SELECT |
STR_TO_DATE(
|
`Col_Name`,
|
'%Y-%m-%d %H:%i:%S.%f' /* datetime2: YYYY-MM-DD HH:MM:SS.fff */ |
) AS `Col_Name` |
FROM |
`t_name_connect`;
|
Although a little verbose, works.
So:
- Could TABNAME accept `[`, `]` Characters?
- Any way to make work SRCDEF with Microsoft PDW and the Discovery Process?
- Any more comfortable way to handle dates in the way shown without losing precision?
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Description |
Some minor issues when using MariaDB's Connect ODBC Table_Type Engine with Microsoft Parallel Data Warehouse (PDW):
h3. table_options: TABNAME When using a Table Definition such as the following for importing a Table: {code:sql} USE db_name; CREATE OR REPLACE TABLE `t_name_connect` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=db_user_name,Password=********' TABNAME='db_name.schema_name.table_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT * FROM t_name_connect; {code} The Query works perfectly (10/10), and I am able to import my tables easily to MariaDB. However, an observed limitation is that in TABNAME option, I can only specify my table as db_name.schema_name.table_name, and not [db name].[schema name].[table name], which is common syntax for database / schema / table with spaces in TRANSACT-SQL. h3. table_options: SRCDEF With Microsoft PDW, using "SQL Server Native Client 11.0" it is not possible to use SRCDEF table option, as otherwise, we would obtain error: "SQLNumResultCols: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Cursor support is not an implemented feature for SQL Server Parallel DataWarehousing TDS endpoint". This limitation could be avoided with first method, but we are not able create table definitions as the following by means of the Table Discovery Process: {code:sql} CREATE OR REPLACE TABLE `t_SQLServer_Table` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dns_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=*****' SRCDEF=' SELECT * FROM [db_name].[schema_name].[table_name] '; {code} Previous Table definition would only work if we specified manually the Column Definitions. h3. Datetime Field Precission Another issue is Datatime Precission ([CONNECT Data Types|https://mariadb.com/kb/en/library/connect-data-types/]), which can also be handled with querys such as: {code:sql} CREATE OR REPLACE TABLE `t_name_connect` ( `Col_Name` VARCHAR(255) ) ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=******' TABNAME='db_name.sch_namel.tb_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT STR_TO_DATE( `Col_Name`, '%Y-%m-%d %H:%i:%S.%f' /* datetime2: YYYY-MM-DD HH:MM:SS.fff */ ) AS `Col_Name`, FROM `t_name_connect`; {code} Although a little but verbose, works. So: # Could TABNAME accept `[`, `]` Characters? # Any way to make work SRCDEF with Microsoft PDW? # Any more comfortable way to handle dates in the way shown without losing precision? |
Some minor issues when using MariaDB's Connect ODBC Table_Type Engine with Microsoft Parallel Data Warehouse (PDW):
h3. table_options: TABNAME When using a Table Definition such as the following for importing a Table: {code:sql} USE db_name; CREATE OR REPLACE TABLE `t_name_connect` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=db_user_name,Password=********' TABNAME='db_name.schema_name.table_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT * FROM t_name_connect; {code} The Query works perfectly (10/10), and I am able to import my tables easily to MariaDB. However, an observed limitation is that in TABNAME option, I can only specify my table as db_name.schema_name.table_name, and not [db name].[schema name].[table name], which is common syntax for database / schema / table with spaces in TRANSACT-SQL. h3. table_options: SRCDEF With Microsoft PDW, using "SQL Server Native Client 11.0" it is not possible to use SRCDEF table option, as otherwise, we would obtain error: "SQLNumResultCols: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Cursor support is not an implemented feature for SQL Server Parallel DataWarehousing TDS endpoint". This limitation could be avoided with first method, but we are not able create table definitions as the following by means of the Table Discovery Process: {code:sql} CREATE OR REPLACE TABLE `t_SQLServer_Table` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dns_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=*****' SRCDEF=' SELECT * FROM [db_name].[schema_name].[table_name] '; {code} Previous Table definition would only work if we specified manually the Column Definitions. h3. Datetime Field Precission Another issue is Datatime Precission ([CONNECT Data Types|https://mariadb.com/kb/en/library/connect-data-types/]), which can also be handled with querys such as: {code:sql} CREATE OR REPLACE TABLE `t_name_connect` ( `Col_Name` VARCHAR(255) ) ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=******' TABNAME='db_name.sch_namel.tb_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT STR_TO_DATE( `Col_Name`, '%Y-%m-%d %H:%i:%S.%f' /* datetime2: YYYY-MM-DD HH:MM:SS.fff */ ) AS `Col_Name`, FROM `t_name_connect`; {code} Although a little verbose, works. So: # Could TABNAME accept `[`, `]` Characters? # Any way to make work SRCDEF with Microsoft PDW? # Any more comfortable way to handle dates in the way shown without losing precision? |
Description |
Some minor issues when using MariaDB's Connect ODBC Table_Type Engine with Microsoft Parallel Data Warehouse (PDW):
h3. table_options: TABNAME When using a Table Definition such as the following for importing a Table: {code:sql} USE db_name; CREATE OR REPLACE TABLE `t_name_connect` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=db_user_name,Password=********' TABNAME='db_name.schema_name.table_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT * FROM t_name_connect; {code} The Query works perfectly (10/10), and I am able to import my tables easily to MariaDB. However, an observed limitation is that in TABNAME option, I can only specify my table as db_name.schema_name.table_name, and not [db name].[schema name].[table name], which is common syntax for database / schema / table with spaces in TRANSACT-SQL. h3. table_options: SRCDEF With Microsoft PDW, using "SQL Server Native Client 11.0" it is not possible to use SRCDEF table option, as otherwise, we would obtain error: "SQLNumResultCols: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Cursor support is not an implemented feature for SQL Server Parallel DataWarehousing TDS endpoint". This limitation could be avoided with first method, but we are not able create table definitions as the following by means of the Table Discovery Process: {code:sql} CREATE OR REPLACE TABLE `t_SQLServer_Table` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dns_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=*****' SRCDEF=' SELECT * FROM [db_name].[schema_name].[table_name] '; {code} Previous Table definition would only work if we specified manually the Column Definitions. h3. Datetime Field Precission Another issue is Datatime Precission ([CONNECT Data Types|https://mariadb.com/kb/en/library/connect-data-types/]), which can also be handled with querys such as: {code:sql} CREATE OR REPLACE TABLE `t_name_connect` ( `Col_Name` VARCHAR(255) ) ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=******' TABNAME='db_name.sch_namel.tb_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT STR_TO_DATE( `Col_Name`, '%Y-%m-%d %H:%i:%S.%f' /* datetime2: YYYY-MM-DD HH:MM:SS.fff */ ) AS `Col_Name`, FROM `t_name_connect`; {code} Although a little verbose, works. So: # Could TABNAME accept `[`, `]` Characters? # Any way to make work SRCDEF with Microsoft PDW? # Any more comfortable way to handle dates in the way shown without losing precision? |
Some minor issues when using MariaDB's Connect ODBC Table_Type Engine with Microsoft Parallel Data Warehouse (PDW):
h3. table_options: TABNAME When using a Table Definition such as the following for importing a Table: {code:sql} USE db_name; CREATE OR REPLACE TABLE `t_name_connect` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=db_user_name,Password=********' TABNAME='db_name.schema_name.table_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT * FROM t_name_connect; {code} The Query works perfectly (10/10), and I am able to import my tables easily to MariaDB. However, an observed limitation is that in TABNAME option, I can only specify my table as: * db_name.schema_name.table_name. * And not [db name].[schema name].[table name], which is common syntax for database / schema / table with spaces in TRANSACT-SQL. h3. table_options: SRCDEF With Microsoft PDW, using "SQL Server Native Client 11.0" it is not possible to use SRCDEF table option, as otherwise, we would obtain error: "SQLNumResultCols: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Cursor support is not an implemented feature for SQL Server Parallel DataWarehousing TDS endpoint". This limitation could be avoided with first method, but we are not able create table definitions as the following by means of the Table Discovery Process: {code:sql} CREATE OR REPLACE TABLE `t_SQLServer_Table` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dns_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=*****' SRCDEF=' SELECT * FROM [db_name].[schema_name].[table_name] '; {code} Previous Table definition would only work if we specified manually the Column Definitions. h3. Datetime Field Precission Another issue is Datatime Precission ([CONNECT Data Types|https://mariadb.com/kb/en/library/connect-data-types/]), which can also be handled with querys such as: {code:sql} CREATE OR REPLACE TABLE `t_name_connect` ( `Col_Name` VARCHAR(255) ) ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=******' TABNAME='db_name.sch_namel.tb_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT STR_TO_DATE( `Col_Name`, '%Y-%m-%d %H:%i:%S.%f' /* datetime2: YYYY-MM-DD HH:MM:SS.fff */ ) AS `Col_Name`, FROM `t_name_connect`; {code} Although a little verbose, works. So: # Could TABNAME accept `[`, `]` Characters? # Any way to make work SRCDEF with Microsoft PDW? # Any more comfortable way to handle dates in the way shown without losing precision? |
Fix Version/s | 10.3 [ 22126 ] | |
Assignee | Olivier Bertrand [ bertrandop ] |
Description |
Some minor issues when using MariaDB's Connect ODBC Table_Type Engine with Microsoft Parallel Data Warehouse (PDW):
h3. table_options: TABNAME When using a Table Definition such as the following for importing a Table: {code:sql} USE db_name; CREATE OR REPLACE TABLE `t_name_connect` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=db_user_name,Password=********' TABNAME='db_name.schema_name.table_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT * FROM t_name_connect; {code} The Query works perfectly (10/10), and I am able to import my tables easily to MariaDB. However, an observed limitation is that in TABNAME option, I can only specify my table as: * db_name.schema_name.table_name. * And not [db name].[schema name].[table name], which is common syntax for database / schema / table with spaces in TRANSACT-SQL. h3. table_options: SRCDEF With Microsoft PDW, using "SQL Server Native Client 11.0" it is not possible to use SRCDEF table option, as otherwise, we would obtain error: "SQLNumResultCols: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Cursor support is not an implemented feature for SQL Server Parallel DataWarehousing TDS endpoint". This limitation could be avoided with first method, but we are not able create table definitions as the following by means of the Table Discovery Process: {code:sql} CREATE OR REPLACE TABLE `t_SQLServer_Table` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dns_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=*****' SRCDEF=' SELECT * FROM [db_name].[schema_name].[table_name] '; {code} Previous Table definition would only work if we specified manually the Column Definitions. h3. Datetime Field Precission Another issue is Datatime Precission ([CONNECT Data Types|https://mariadb.com/kb/en/library/connect-data-types/]), which can also be handled with querys such as: {code:sql} CREATE OR REPLACE TABLE `t_name_connect` ( `Col_Name` VARCHAR(255) ) ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=******' TABNAME='db_name.sch_namel.tb_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT STR_TO_DATE( `Col_Name`, '%Y-%m-%d %H:%i:%S.%f' /* datetime2: YYYY-MM-DD HH:MM:SS.fff */ ) AS `Col_Name`, FROM `t_name_connect`; {code} Although a little verbose, works. So: # Could TABNAME accept `[`, `]` Characters? # Any way to make work SRCDEF with Microsoft PDW? # Any more comfortable way to handle dates in the way shown without losing precision? |
Some minor issues when using MariaDB's Connect ODBC Table_Type Engine with Microsoft Parallel Data Warehouse (PDW):
h3. table_options: TABNAME When using a Table Definition such as the following for importing a Table: {code:sql} USE db_name; CREATE OR REPLACE TABLE `t_name_connect` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=db_user_name,Password=********' TABNAME='db_name.schema_name.table_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT * FROM t_name_connect; {code} The Query works perfectly (10/10), and I am able to import my tables easily to MariaDB. However, an observed limitation is that in TABNAME option, I can only specify my table as: * db_name.schema_name.table_name. * And not [db name].[schema name].[table name], which is common syntax for database / schema / table with spaces in TRANSACT-SQL. h3. table_options: SRCDEF With Microsoft PDW, using "SQL Server Native Client 11.0" it is not possible to use SRCDEF table option, as otherwise, we would obtain error: "SQLNumResultCols: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Cursor support is not an implemented feature for SQL Server Parallel DataWarehousing TDS endpoint". This limitation could be avoided with first method, but we are not able create table definitions as the following by means of the Table Discovery Process: {code:sql} CREATE OR REPLACE TABLE `t_SQLServer_Table` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dns_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=*****' SRCDEF=' SELECT * FROM [db_name].[schema_name].[table_name] '; {code} Previous Table definition would only work if we specified manually the Column Definitions. h3. Datetime Field Precission Another issue is Datetime Precission ([CONNECT Data Types|https://mariadb.com/kb/en/library/connect-data-types/]), which can also be handled with querys such as: {code:sql} CREATE OR REPLACE TABLE `t_name_connect` ( `Col_Name` VARCHAR(255) ) ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=******' TABNAME='db_name.sch_namel.tb_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT STR_TO_DATE( `Col_Name`, '%Y-%m-%d %H:%i:%S.%f' /* datetime2: YYYY-MM-DD HH:MM:SS.fff */ ) AS `Col_Name`, FROM `t_name_connect`; {code} Although a little verbose, works. So: # Could TABNAME accept `[`, `]` Characters? # Any way to make work SRCDEF with Microsoft PDW? # Any more comfortable way to handle dates in the way shown without losing precision? |
Description |
Some minor issues when using MariaDB's Connect ODBC Table_Type Engine with Microsoft Parallel Data Warehouse (PDW):
h3. table_options: TABNAME When using a Table Definition such as the following for importing a Table: {code:sql} USE db_name; CREATE OR REPLACE TABLE `t_name_connect` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=db_user_name,Password=********' TABNAME='db_name.schema_name.table_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT * FROM t_name_connect; {code} The Query works perfectly (10/10), and I am able to import my tables easily to MariaDB. However, an observed limitation is that in TABNAME option, I can only specify my table as: * db_name.schema_name.table_name. * And not [db name].[schema name].[table name], which is common syntax for database / schema / table with spaces in TRANSACT-SQL. h3. table_options: SRCDEF With Microsoft PDW, using "SQL Server Native Client 11.0" it is not possible to use SRCDEF table option, as otherwise, we would obtain error: "SQLNumResultCols: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Cursor support is not an implemented feature for SQL Server Parallel DataWarehousing TDS endpoint". This limitation could be avoided with first method, but we are not able create table definitions as the following by means of the Table Discovery Process: {code:sql} CREATE OR REPLACE TABLE `t_SQLServer_Table` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dns_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=*****' SRCDEF=' SELECT * FROM [db_name].[schema_name].[table_name] '; {code} Previous Table definition would only work if we specified manually the Column Definitions. h3. Datetime Field Precission Another issue is Datetime Precission ([CONNECT Data Types|https://mariadb.com/kb/en/library/connect-data-types/]), which can also be handled with querys such as: {code:sql} CREATE OR REPLACE TABLE `t_name_connect` ( `Col_Name` VARCHAR(255) ) ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=******' TABNAME='db_name.sch_namel.tb_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT STR_TO_DATE( `Col_Name`, '%Y-%m-%d %H:%i:%S.%f' /* datetime2: YYYY-MM-DD HH:MM:SS.fff */ ) AS `Col_Name`, FROM `t_name_connect`; {code} Although a little verbose, works. So: # Could TABNAME accept `[`, `]` Characters? # Any way to make work SRCDEF with Microsoft PDW? # Any more comfortable way to handle dates in the way shown without losing precision? |
Some minor issues when using MariaDB's Connect ODBC Table_Type Engine with Microsoft Parallel Data Warehouse (PDW):
h3. table_options: TABNAME When using a Table Definition such as the following for importing a Table: {code:sql} USE db_name; CREATE OR REPLACE TABLE `t_name_connect` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=db_user_name,Password=********' TABNAME='db_name.schema_name.table_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT * FROM t_name_connect; {code} The Query works perfectly (10/10), and I am able to import my tables easily to MariaDB. However, an observed limitation is that in TABNAME option, I can only specify my table as: * db_name.schema_name.table_name. * And not [db name].[schema name].[table name], which is common syntax for database / schema / table with spaces in TRANSACT-SQL. h3. table_options: SRCDEF With Microsoft PDW, using "SQL Server Native Client 11.0" it is not possible to use SRCDEF table option, as otherwise, we would obtain error: "SQLNumResultCols: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Cursor support is not an implemented feature for SQL Server Parallel DataWarehousing TDS endpoint". This limitation could be avoided with first method, but we are not able create table definitions as the following by means of the Table Discovery Process: {code:sql} CREATE OR REPLACE TABLE `t_SQLServer_Table` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dns_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=*****' SRCDEF=' SELECT * FROM [db_name].[schema_name].[table_name] '; {code} Previous Table definition would only work if we specified manually the Column Definitions. h3. Datetime Field Precission Another issue is Datetime Precission ([CONNECT Data Types|https://mariadb.com/kb/en/library/connect-data-types/]), which can also be handled with querys such as: {code:sql} CREATE OR REPLACE TABLE `t_name_connect` ( `Col_Name` VARCHAR(255) ) ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=******' TABNAME='db_name.sch_namel.tb_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT STR_TO_DATE( `Col_Name`, '%Y-%m-%d %H:%i:%S.%f' /* datetime2: YYYY-MM-DD HH:MM:SS.fff */ ) AS `Col_Name` FROM `t_name_connect`; {code} Although a little verbose, works. So: # Could TABNAME accept `[`, `]` Characters? # Any way to make work SRCDEF with Microsoft PDW? # Any more comfortable way to handle dates in the way shown without losing precision? |
Description |
Some minor issues when using MariaDB's Connect ODBC Table_Type Engine with Microsoft Parallel Data Warehouse (PDW):
h3. table_options: TABNAME When using a Table Definition such as the following for importing a Table: {code:sql} USE db_name; CREATE OR REPLACE TABLE `t_name_connect` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=db_user_name,Password=********' TABNAME='db_name.schema_name.table_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT * FROM t_name_connect; {code} The Query works perfectly (10/10), and I am able to import my tables easily to MariaDB. However, an observed limitation is that in TABNAME option, I can only specify my table as: * db_name.schema_name.table_name. * And not [db name].[schema name].[table name], which is common syntax for database / schema / table with spaces in TRANSACT-SQL. h3. table_options: SRCDEF With Microsoft PDW, using "SQL Server Native Client 11.0" it is not possible to use SRCDEF table option, as otherwise, we would obtain error: "SQLNumResultCols: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Cursor support is not an implemented feature for SQL Server Parallel DataWarehousing TDS endpoint". This limitation could be avoided with first method, but we are not able create table definitions as the following by means of the Table Discovery Process: {code:sql} CREATE OR REPLACE TABLE `t_SQLServer_Table` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dns_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=*****' SRCDEF=' SELECT * FROM [db_name].[schema_name].[table_name] '; {code} Previous Table definition would only work if we specified manually the Column Definitions. h3. Datetime Field Precission Another issue is Datetime Precission ([CONNECT Data Types|https://mariadb.com/kb/en/library/connect-data-types/]), which can also be handled with querys such as: {code:sql} CREATE OR REPLACE TABLE `t_name_connect` ( `Col_Name` VARCHAR(255) ) ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=******' TABNAME='db_name.sch_namel.tb_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT STR_TO_DATE( `Col_Name`, '%Y-%m-%d %H:%i:%S.%f' /* datetime2: YYYY-MM-DD HH:MM:SS.fff */ ) AS `Col_Name` FROM `t_name_connect`; {code} Although a little verbose, works. So: # Could TABNAME accept `[`, `]` Characters? # Any way to make work SRCDEF with Microsoft PDW? # Any more comfortable way to handle dates in the way shown without losing precision? |
Some minor issues when using MariaDB's Connect ODBC Table_Type Engine with Microsoft Parallel Data Warehouse (PDW):
h3. table_options: TABNAME When using a Table Definition such as the following for importing a Table: {code:sql} USE db_name; CREATE OR REPLACE TABLE `t_name_connect` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=db_user_name,Password=********' TABNAME='db_name.schema_name.table_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT * FROM t_name_connect; {code} The Query works perfectly (10/10), and I am able to import my tables easily to MariaDB. However, an observed limitation is that in TABNAME option, I can only specify my table as: * db_name.schema_name.table_name. * And not [db name].[schema name].[table name], which is common syntax for database / schema / table with spaces in TRANSACT-SQL. h3. table_options: SRCDEF With Microsoft PDW, using "SQL Server Native Client 11.0" it is not possible to use SRCDEF table option, as otherwise, we would obtain error: "SQLNumResultCols: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Cursor support is not an implemented feature for SQL Server Parallel DataWarehousing TDS endpoint". This limitation could be avoided with first method, but we are not able create table definitions as the following by means of the Table Discovery Process: {code:sql} CREATE OR REPLACE TABLE `t_SQLServer_Table` ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dns_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=*****' SRCDEF=' SELECT * FROM [db_name].[schema_name].[table_name] '; {code} Previous Table definition would only work if we specified manually the Column Definitions. h3. Datetime Field Precission Another issue is Datetime Precission ([CONNECT Data Types|https://mariadb.com/kb/en/library/connect-data-types/]), which can also be handled with querys such as: {code:sql} CREATE OR REPLACE TABLE `t_name_connect` ( `Col_Name` VARCHAR(255) ) ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='dsn_name' OPTION_LIST='UseDSN=Yes,User=user_name,Password=******' TABNAME='db_name.sch_namel.tb_name'; CREATE OR REPLACE TABLE t_name_mariadb AS SELECT STR_TO_DATE( `Col_Name`, '%Y-%m-%d %H:%i:%S.%f' /* datetime2: YYYY-MM-DD HH:MM:SS.fff */ ) AS `Col_Name` FROM `t_name_connect`; {code} Although a little verbose, works. So: # Could TABNAME accept `[`, `]` Characters? # Any way to make work SRCDEF with Microsoft PDW and the Discovery Process? # Any more comfortable way to handle dates in the way shown without losing precision? |
Attachment | MySQL Integer Types.PNG [ 46493 ] |
issue.field.resolutiondate | 2018-09-23 17:44:12.0 | 2018-09-23 17:44:12.732 |
Fix Version/s | N/A [ 14700 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Resolution | Won't Do [ 10201 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Resolution | Won't Do [ 10201 ] | |
Status | Closed [ 6 ] | Stalled [ 10000 ] |
issue.field.resolutiondate | 2018-10-15 08:50:30.0 | 2018-10-15 08:50:30.151 |
Fix Version/s | 10.0.37 [ 22917 ] | |
Fix Version/s | 10.3.11 [ 23141 ] | |
Fix Version/s | 10.1.37 [ 23204 ] | |
Fix Version/s | 10.2.19 [ 23207 ] | |
Fix Version/s | N/A [ 14700 ] | |
Resolution | Done [ 10200 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 89626 ] | MariaDB v4 [ 154941 ] |
1: Accepting brackets is probably specific to some data source. For instance, this syntax is not accepted by PostgreSQL.
2: This should work, the issue is in defining the table name as db_name.sch_namel.tb_name;
3: Cannot reproduce.
Even in some case the database or schema can be specified in the table name, this is not recommended and is also dependant on the data source. For instance:
create or replace table pgtst (id int not null)
engine=CONNECT table_type=ODBC tabname='test.postgres.tst'
connection='PostgreSQL30'
option_list='UseDSN=1';
select * from pgtst;
This does not work because the DSN was specified to use the public database and PosgreSQL does not implement references between databases. Therefore the database should be specified in the connection string:
create or replace table pgtst (n int not null)
engine=CONNECT table_type=ODBC tabname=tst
connection='DSN=PostgreSQL30;Database=test';
select * from pgtst;
This works alright. Note also that in the connection string the database name can include blanks, which solves problem 1.