Request for the Export of BLOB and then the Import of BLOB to be improved for BLOB, it seems to export and change the datatype and therefore Import is inaccurate.
Feedback from customer:
It will succeed. But it will show inaccurate data as when you download in excel, blob columns are downloaded as text(7b3030….). When you export it back it assumes this a text and converts this data to (3634363137343631336……..) in the target column which is blob. The actual data from source to target is lost. I don’t believe downloading blob in excel and importing it back to blob in target is the right way to handle blob columns.
There is no error on either steps(import or export). The issue is export brings blob as strings of hex values in excel and import will put this string into blob) while this happens the content is changed as anything you insert into blob column is changed into hex/binary format. I request you to try exporting and importing the blob column and you will understand the issue. The content from source to target is not the same. The 4 options that you see is not sufficient to handle blob columns. You might need to add additional support to handle such columns
|
139 KB
|
62 KB
![]() |
2 KB
![]() |
3 KB
![]() |
985 KB
![]() |
80 KB
|
66 KB
![]() |
3 KB
![]() |
32 B
![]() |
6 KB
|
95 KB
|
70 KB
|
70 KB
|
139 KB
Which databases?
Forgot to add platforms:
Target is MySQL. The source was Oracle in this example.
Forgot to add platforms:
Target is MySQL. The source was Oracle in this example.
I don't think we can support this as requested. Each blob value equates to a separate file. If exporting multiple rows, this equates to generating multiple files. IMO import/export is not the right place to handle blobs.
For this issue, we should probably add an option to exclude blob columns during export, and display a warning (ie "importing into a blob column will not work as intended") when importing into a blob column.
I don't think we can support this as requested. Each blob value equates to a separate file. If exporting multiple rows, this equates to generating multiple files. IMO import/export is not the right place to handle blobs.
For this issue, we should probably add an option to exclude blob columns during export, and display a warning (ie "importing into a blob column will not work as intended") when importing into a blob column.
ADS currently exports BLOB columns based on the "File > Options > Results > Convert binary to hex" setting. However the import does not take this setting into account. Thus the IMPORT does NOT import exactly what is exported for BLOB column when this setting is turn ON. For example the BLOB values is exported as a HEX string, but is imported as a literal raw value.
For this issue, we need to fix the IMPORT so that it considers the "File > Options > Results > Convert binary to hex" setting. If this setting is OFF, then it should continue the current behavior. If this setting is ON, then ADS needs to assume that the blob values in the import file is hex encoded, and import the BLOB values as HEX strings using the correct format for each supported database type. Note that IMPORT is implemented as a bunch of INSERT statements. Different database types may have different formats for inserting HEX strings. For example in DB2 LUW, the insert statement looks like this: INSERT INTO some_table(..., blob_column) VALUES(..., blob(x'some_hex_string'))
This issue will involve researching the correct format for each supported database. The import will have to work correctly for each supported database.
Note that BLOB values can potentially be very large. In this issue, we need to gracefully handle the low memory or out of memory condition. For example, during such condition, ADS should NOT hang or crash, but should display an error dialog with the message:
There is insufficient memory to perform this operation. Please increase the amount of memory available to the application and the JVM according to the application documentation and restart.
This error dialog and message already exist in ADS, and the condition is already handled. This handling needs to be validated due to the nature of BLOB values being large and such condition is more like to occur when importing BLOB values.
Attached Import-Blob.patch contains the fix for a few databases (Oracle, DB2, etc.). Will need to test and fix for all supported databases.
ADS currently exports BLOB columns based on the "File > Options > Results > Convert binary to hex" setting. However the import does not take this setting into account. Thus the IMPORT does NOT import exactly what is exported for BLOB column when this setting is turn ON. For example the BLOB values is exported as a HEX string, but is imported as a literal raw value.
For this issue, we need to fix the IMPORT so that it considers the "File > Options > Results > Convert binary to hex" setting. If this setting is OFF, then it should continue the current behavior. If this setting is ON, then ADS needs to assume that the blob values in the import file is hex encoded, and import the BLOB values as HEX strings using the correct format for each supported database type. Note that IMPORT is implemented as a bunch of INSERT statements. Different database types may have different formats for inserting HEX strings. For example in DB2 LUW, the insert statement looks like this: INSERT INTO some_table(..., blob_column) VALUES(..., blob(x'some_hex_string'))
This issue will involve researching the correct format for each supported database. The import will have to work correctly for each supported database.
Note that BLOB values can potentially be very large. In this issue, we need to gracefully handle the low memory or out of memory condition. For example, during such condition, ADS should NOT hang or crash, but should display an error dialog with the message:
There is insufficient memory to perform this operation. Please increase the amount of memory available to the application and the JVM according to the application documentation and restart.
This error dialog and message already exist in ADS, and the condition is already handled. This handling needs to be validated due to the nature of BLOB values being large and such condition is more like to occur when importing BLOB values.
Attached Import-Blob.patch contains the fix for a few databases (Oracle, DB2, etc.). Will need to test and fix for all supported databases.
Revision no. 57503
Author: ajit.kulkarni
<aquadatastudio:#15687> Improve Export and Import for BLOBs cross databases
Changes:
1. Added support import blob datatype while import file for some databases and
will continue with remaining database those are supports blob datatype or syntax
Revision no. 57503
Author: ajit.kulkarni
<aquadatastudio:#15687> Improve Export and Import for BLOBs cross databases
Changes:
1. Added support import blob datatype while import file for some databases and
will continue with remaining database those are supports blob datatype or syntax
@nhi Please find below list of database, those are fixed, doesn't support blob or insert query with blob datatype databases and working on other databases.
Amazon Redshift(Doesn't support BLOB datatype)
Apache Cassandra
Apachy Derby(Insert query doesn’t support BLOB datatype)
Hive(Doesn't support BLOB datatype)
DB2
Greenplum(Doesn't support BLOB datatype)
Informix(Insert query doesn’t support BLOB datatype)
Maria
Mysql
MS SQL Server(!Doesn't support BLOB datatype)
Oracle
@nhi Please find below list of database, those are fixed, doesn't support blob or insert query with blob datatype databases and working on other databases.
Amazon Redshift(Doesn't support BLOB datatype)
Apache Cassandra
Apachy Derby(Insert query doesn’t support BLOB datatype)
Hive(Doesn't support BLOB datatype)
DB2
Greenplum(Doesn't support BLOB datatype)
Informix(Insert query doesn’t support BLOB datatype)
Maria
Mysql
MS SQL Server(!Doesn't support BLOB datatype)
Oracle
@Dev,
For MS SQL Server, we can insert BLOB data using insert statements. Here is sample program. And the blob data format looks like this:
String s = "0xC9CBBBCCCEB9C8CABCCCCEB9C9CBBB"; //SQL Server format
Table DML:
CREATE TABLE `dbo`.`test_blob` ( `name` varchar(25) NULL, `baddress` varbinary(2000) NULL ) ON `PRIMARY` WITH ( DATA_COMPRESSION = NONE ) GO
@Dev,
For MS SQL Server, we can insert BLOB data using insert statements. Here is sample program. And the blob data format looks like this:
String s = "0xC9CBBBCCCEB9C8CABCCCCEB9C9CBBB"; //SQL Server format
Table DML:
CREATE TABLE `dbo`.`test_blob` ( `name` varchar(25) NULL, `baddress` varbinary(2000) NULL ) ON `PRIMARY` WITH ( DATA_COMPRESSION = NONE ) GO
@Asif,
As mention in the ticket, we are considering only BLOB datatype for Import and Export and fixing for BLOB datatype.
Let us know your view point on that.
@Asif,
As mention in the ticket, we are considering only BLOB datatype for Import and Export and fixing for BLOB datatype.
Let us know your view point on that.
Whatever changes are made to the ImportThread and ExportThread classes should also be made to the CoreLibImportThread and CoreLibExportThread classes. CoreLibImportThread/CoreLibExportThread is used to support Fluidshell SQLImport/SQLExport. These should also be tested with the same test cases as ImportThread/ExportThread.
There is no corresponding class in Fludishell for ImportExeclImportThread as this is not supported.
Whatever changes are made to the ImportThread and ExportThread classes should also be made to the CoreLibImportThread and CoreLibExportThread classes. CoreLibImportThread/CoreLibExportThread is used to support Fluidshell SQLImport/SQLExport. These should also be tested with the same test cases as ImportThread/ExportThread.
There is no corresponding class in Fludishell for ImportExeclImportThread as this is not supported.
@Tom, @Nhi Please find below list of databases.
Database |
BLOB Support |
BLOB Insert Query Support |
Amazon Redshift |
N |
N |
Apache Cassandra |
Y |
Y |
Apache Derby |
Y |
N |
Apache Hive |
N |
N |
DB2 |
Y |
Y |
DB2 ISeries |
N |
N |
DB2zOS |
Y |
Y |
Generic |
N |
N |
Google BigQuery |
N |
N |
Greenplum |
N |
N |
Informix |
Y |
N |
Interbase |
Y |
Y |
MS Excel |
N |
N |
MSSQL |
N |
N |
MariaDB |
Y |
Y |
MongoDB |
N |
N |
MySQL |
Y |
Y |
Netezza |
N |
N |
Oracle |
Y |
Y |
ParAccel |
N |
N |
PostgreSQL |
N |
N |
SAP HANA |
Y |
Y |
SQLite |
Y |
Y |
Snowflake |
N |
N |
Sysbase ASE/Anywhere |
N |
N |
Sysbase IQ |
Y |
Y |
Teradata |
Y |
Y |
Vertica |
N |
N |
VoltDB |
N |
N |
@Tom, @Nhi Please find below list of databases.
Database |
BLOB Support |
BLOB Insert Query Support |
Amazon Redshift |
N |
N |
Apache Cassandra |
Y |
Y |
Apache Derby |
Y |
N |
Apache Hive |
N |
N |
DB2 |
Y |
Y |
DB2 ISeries |
N |
N |
DB2zOS |
Y |
Y |
Generic |
N |
N |
Google BigQuery |
N |
N |
Greenplum |
N |
N |
Informix |
Y |
N |
Interbase |
Y |
Y |
MS Excel |
N |
N |
MSSQL |
N |
N |
MariaDB |
Y |
Y |
MongoDB |
N |
N |
MySQL |
Y |
Y |
Netezza |
N |
N |
Oracle |
Y |
Y |
ParAccel |
N |
N |
PostgreSQL |
N |
N |
SAP HANA |
Y |
Y |
SQLite |
Y |
Y |
Snowflake |
N |
N |
Sysbase ASE/Anywhere |
N |
N |
Sysbase IQ |
Y |
Y |
Teradata |
Y |
Y |
Vertica |
N |
N |
VoltDB |
N |
N |
@Ajit, please recheck the BLOB support for each database type where you currently indicate that it is not supported. Some database supports it, but it may use a different name for the data type. Basically when we say BLOB in this issue, we meant binary data type (BLOB stands for binary large object). For example MS SQLServer calls it BINARY or VARBINARY; they mean the same as BLOB. Please see: https://www.developer.com/net/asp/article.php/3761486/Working-with-Binary-Large-Objects-BLOBs-Using-SQL-Server-and-ADONET.htm
@Ajit, please recheck the BLOB support for each database type where you currently indicate that it is not supported. Some database supports it, but it may use a different name for the data type. Basically when we say BLOB in this issue, we meant binary data type (BLOB stands for binary large object). For example MS SQLServer calls it BINARY or VARBINARY; they mean the same as BLOB. Please see: https://www.developer.com/net/asp/article.php/3761486/Working-with-Binary-Large-Objects-BLOBs-Using-SQL-Server-and-ADONET.htm
As mention in the ticket, we are considering only BLOB datatype for Import and Export and fixing for BLOB datatype.
@Ajit, please update the table you have listed here to include the actual blob data type name. As Nhi pointed out we might have missed some blob datatypes.
As Tom, we will have implications in Fluidshell sqlexport
and sqlimport
commands for blob support.
Thanks
As mention in the ticket, we are considering only BLOB datatype for Import and Export and fixing for BLOB datatype.
@Ajit, please update the table you have listed here to include the actual blob data type name. As Nhi pointed out we might have missed some blob datatypes.
As Tom, we will have implications in Fluidshell sqlexport
and sqlimport
commands for blob support.
Thanks
@All Please find below list of databases, those are supports BLOB datatype.
Database |
BLOB |
BLOB Insert Query |
BINARY |
BINARY Insert Query |
Datatypes |
Amazon Redshift |
N |
N |
N |
N |
|
Apache Cassandra |
Y |
Y |
N |
N |
|
Apache Derby |
Y |
Y |
N |
N |
|
Apache Hive |
N |
N |
Y |
Y |
Binary |
DB2 |
Y |
Y |
N |
N |
|
DB2 ISeries |
N |
N |
Y |
Y |
Binary, Varbinary |
DB2zOS |
Y |
Y |
Y |
Y |
Binary, Varbinary |
Generic |
N |
N |
N |
N |
|
Google BigQuery |
N |
N |
N |
N |
|
Greenplum |
N |
N |
N |
N |
|
Informix |
Y |
N |
Y |
N |
Byte, Text |
Interbase |
Y |
Y |
N |
N |
|
MS Excel |
N |
N |
N |
N |
|
MSSQL Azure |
N |
N |
Y |
Y |
Binary, Varbinary |
MSSQL |
N |
N |
Y |
Y |
Binary, Varbinary |
MariaDB |
Y |
Y |
Y |
Y |
Binary |
MongoDB |
N |
N |
Y |
Y |
Binary |
MySQL |
Y |
Y |
Y |
Y |
Binary, Varbinary |
Netezza |
N |
N |
N |
N |
|
Oracle |
Y |
Y |
N |
N |
|
ParAccel |
N |
N |
N |
N |
|
PostgreSQL |
N |
N |
N |
N |
|
SAP HANA |
Y |
Y |
Y |
Y |
Binary, Varbinary |
SQLite |
Y |
Y |
N |
N |
|
Snowflake |
N |
N |
Y |
Y |
Binary, Varbinary |
Sysbase ASE/Anywhere |
N |
N |
Y |
Y |
Binary, Varbinary |
Sysbase IQ |
Y |
Y |
Y |
Y |
Binary, Varbinary |
Teradata |
Y |
Y |
Y |
Y |
Varbyte |
Vertica |
N |
N |
Y |
Y |
Binary, Varbinary, Long Varbinary |
@All Please find below list of databases, those are supports BLOB datatype.
Database |
BLOB |
BLOB Insert Query |
BINARY |
BINARY Insert Query |
Datatypes |
Amazon Redshift |
N |
N |
N |
N |
|
Apache Cassandra |
Y |
Y |
N |
N |
|
Apache Derby |
Y |
Y |
N |
N |
|
Apache Hive |
N |
N |
Y |
Y |
Binary |
DB2 |
Y |
Y |
N |
N |
|
DB2 ISeries |
N |
N |
Y |
Y |
Binary, Varbinary |
DB2zOS |
Y |
Y |
Y |
Y |
Binary, Varbinary |
Generic |
N |
N |
N |
N |
|
Google BigQuery |
N |
N |
N |
N |
|
Greenplum |
N |
N |
N |
N |
|
Informix |
Y |
N |
Y |
N |
Byte, Text |
Interbase |
Y |
Y |
N |
N |
|
MS Excel |
N |
N |
N |
N |
|
MSSQL Azure |
N |
N |
Y |
Y |
Binary, Varbinary |
MSSQL |
N |
N |
Y |
Y |
Binary, Varbinary |
MariaDB |
Y |
Y |
Y |
Y |
Binary |
MongoDB |
N |
N |
Y |
Y |
Binary |
MySQL |
Y |
Y |
Y |
Y |
Binary, Varbinary |
Netezza |
N |
N |
N |
N |
|
Oracle |
Y |
Y |
N |
N |
|
ParAccel |
N |
N |
N |
N |
|
PostgreSQL |
N |
N |
N |
N |
|
SAP HANA |
Y |
Y |
Y |
Y |
Binary, Varbinary |
SQLite |
Y |
Y |
N |
N |
|
Snowflake |
N |
N |
Y |
Y |
Binary, Varbinary |
Sysbase ASE/Anywhere |
N |
N |
Y |
Y |
Binary, Varbinary |
Sysbase IQ |
Y |
Y |
Y |
Y |
Binary, Varbinary |
Teradata |
Y |
Y |
Y |
Y |
Varbyte |
Vertica |
N |
N |
Y |
Y |
Binary, Varbinary, Long Varbinary |
@Tom, @Asif I have added support for all databases, those are supports BLOB/Binary datatype except Informix. I have gone through their documentation but could not able to get helpful information. It seems that Informix databases doesn't supports insert query. And for now I added null value where insert doesn't supports.
Would you let me know, if you finds any helpful information.
@Tom, @Asif I have added support for all databases, those are supports BLOB/Binary datatype except Informix. I have gone through their documentation but could not able to get helpful information. It seems that Informix databases doesn't supports insert query. And for now I added null value where insert doesn't supports.
Would you let me know, if you finds any helpful information.
@Ajit, the original patch already handles Informix. Using latest from SVN, I've just tested import of blob data on Informix database (Informix 172.24.1.140 v11.70), and seems to work. It's imported to the "t2" table in the "tom" database.
@Ajit, the original patch already handles Informix. Using latest from SVN, I've just tested import of blob data on Informix database (Informix 172.24.1.140 v11.70), and seems to work. It's imported to the "t2" table in the "tom" database.
@Nhi, In current implementation, we are setting NULL while importing file, if database does not support insert query with BLOB(Informix). Its generates query as INSERT INTO informix.import1(c1) VALUES(NULL).
I have reverted current implementation and added patch code but it gets failed while importing file and gives syntax error. Its generates query as INSERT INTO informix.import(c1) VALUES(x'd0cf11e0a1b11ae....')
@Nhi, In current implementation, we are setting NULL while importing file, if database does not support insert query with BLOB(Informix). Its generates query as INSERT INTO informix.import1(c1) VALUES(NULL).
I have reverted current implementation and added patch code but it gets failed while importing file and gives syntax error. Its generates query as INSERT INTO informix.import(c1) VALUES(x'd0cf11e0a1b11ae....')
I don't think that you can directly insert hex data into blob/clob/byte columns in Informix??
I don't think that you can directly insert hex data into blob/clob/byte columns in Informix??
My test was based on Transaction Type = Batch, which is configured in the last page of the Import wizard. In this mode, the import uses prepared statements.
@Documentation: We need to document that importing BLOBs in Informix must use Transaction Type = Batch in order for the import to work correctly.
@Ajit: Please make sure that you test your code changes with all available Transaction Type in the Import wizard.
My test was based on Transaction Type = Batch, which is configured in the last page of the Import wizard. In this mode, the import uses prepared statements.
@Documentation: We need to document that importing BLOBs in Informix must use Transaction Type = Batch in order for the import to work correctly.
@Ajit: Please make sure that you test your code changes with all available Transaction Type in the Import wizard.
Code changes look good.
So far, the import of XLSX file into Informix database does not work correctly. Please see the attached export-blob.xlsx file.
Note that if you import the attached export-blob.csv file to the same database table, the data will be imported correctly. You can check the correctness of the imported data as follows:
@QA: please test import binary data to every database type that supports some form of binary data. Please import CSV, XLS and XLSX files, and verify that the binary data is imported correctly.
Code changes look good.
So far, the import of XLSX file into Informix database does not work correctly. Please see the attached export-blob.xlsx file.
Note that if you import the attached export-blob.csv file to the same database table, the data will be imported correctly. You can check the correctness of the imported data as follows:
@QA: please test import binary data to every database type that supports some form of binary data. Please import CSV, XLS and XLSX files, and verify that the binary data is imported correctly.
@Nhi, The fields of CSV file/existing table data has length more than 32767 characters. And Microsoft excel supports only 32767 characters per cell. If we try to add more than 32767 characters in excel cell, data gets truncated and result of importing same file data will be incorrect.
[Nhi]: Noted. Thanks, Ajit.
@Documentation: Please add this to the documentation.
@Nhi, The fields of CSV file/existing table data has length more than 32767 characters. And Microsoft excel supports only 32767 characters per cell. If we try to add more than 32767 characters in excel cell, data gets truncated and result of importing same file data will be incorrect.
[Nhi]: Noted. Thanks, Ajit.
@Documentation: Please add this to the documentation.
@Nhi, Derby database insert query for BLOB datatype only supports small data. If try to insert large data it throws below error as "Caused by: ERROR 54002: Error for batch element #0: A string constant starting with 'x'ffd8ffe000104a46494600010101004800480000ffe2021c4943435f50&' is too long." with all transaction types.
After looking into code I found that if we add support of derby in private boolean usePreparedStatement(ConnectionProperties cp) {
method of class ImportThread and select transaction type Batch, it work fine.
Is there any impact on other code, if we add derby database support in usePreparedStatement method to work import large data?
[Nhi] Should not have an impact on other code.
@Nhi, Derby database insert query for BLOB datatype only supports small data. If try to insert large data it throws below error as "Caused by: ERROR 54002: Error for batch element #0: A string constant starting with 'x'ffd8ffe000104a46494600010101004800480000ffe2021c4943435f50&' is too long." with all transaction types.
After looking into code I found that if we add support of derby in private boolean usePreparedStatement(ConnectionProperties cp) {
method of class ImportThread and select transaction type Batch, it work fine.
Is there any impact on other code, if we add derby database support in usePreparedStatement method to work import large data?
[Nhi] Should not have an impact on other code.
Refer below link for "Microsoft excel supports only 32767 characters per cell. If we try to add more than 32767 characters in excel cell, data gets truncated and result of importing same file data will be incorrect".
Refer below link for "Microsoft excel supports only 32767 characters per cell. If we try to add more than 32767 characters in excel cell, data gets truncated and result of importing same file data will be incorrect".
Hi @Ajit,
Found issues in Vertica Database:
Note: For large binary data, referred Nhi's attached export-blob.csv and export-blob.xlsx files
1. a) Binary datatype --> CSV --> Importing small binary data (Binary value cannot exceed 65000)
Also for imported 15 rows using Batch transaction type, data gets lost because it displays different value in the table after import.
1.b) Binary datatype --> Excel --> Importing small binary data
1.c) Binary datatype --> Excel --> Importing long binary data
2.a) Varbinary datatype --> Excel --> Importing Varbinary data
3.a) Long Varbinary datatype --> Excel --> Importing Long Varbinary data
Hi @Ajit,
Found issues in Vertica Database:
Note: For large binary data, referred Nhi's attached export-blob.csv and export-blob.xlsx files
1. a) Binary datatype --> CSV --> Importing small binary data (Binary value cannot exceed 65000)
Also for imported 15 rows using Batch transaction type, data gets lost because it displays different value in the table after import.
1.b) Binary datatype --> Excel --> Importing small binary data
1.c) Binary datatype --> Excel --> Importing long binary data
2.a) Varbinary datatype --> Excel --> Importing Varbinary data
3.a) Long Varbinary datatype --> Excel --> Importing Long Varbinary data
@Tom @Nhi, In Vertica database if hex data has only numbers, then below code gets execute while importing data from file and imported data will be incorrect. Class ImportThread.java line no: 1353
if (NumberUtils.isNumber(columnInfo) && !(columnInfo.contains("x") || columnInfo.contains("X"))) { if (columnInfo.contains(".")) { stmt.setBytes(idx, AQHexUtils.hexToByte(Long.toHexString(Double.doubleToRawLongBits(Double.valueOf(columnInfo))))); } else { BigInteger bigInt = new BigInteger(columnInfo); stmt.setBytes(idx, bigInt.toByteArray()); }
}
Is there any impact on any other functionally, if we refactor this code as below?
stmt.setBytes(idx, AQHexUtils.hexToByte(columnObject.toString()));
[Nhi] Should be fine.
@Tom @Nhi, In Vertica database if hex data has only numbers, then below code gets execute while importing data from file and imported data will be incorrect. Class ImportThread.java line no: 1353
if (NumberUtils.isNumber(columnInfo) && !(columnInfo.contains("x") || columnInfo.contains("X"))) { if (columnInfo.contains(".")) { stmt.setBytes(idx, AQHexUtils.hexToByte(Long.toHexString(Double.doubleToRawLongBits(Double.valueOf(columnInfo))))); } else { BigInteger bigInt = new BigInteger(columnInfo); stmt.setBytes(idx, bigInt.toByteArray()); }
}
Is there any impact on any other functionally, if we refactor this code as below?
stmt.setBytes(idx, AQHexUtils.hexToByte(columnObject.toString()));
[Nhi] Should be fine.
@Tom, @Nhi Hive : Tools > Import Data menu is disabled for Hive database, We are not able to test import data in Hive databases.
Could you help us to enable menu to test import data?
@Tom, @Nhi Hive : Tools > Import Data menu is disabled for Hive database, We are not able to test import data in Hive databases.
Could you help us to enable menu to test import data?
Hi Ajit,
Lets not worry about Hive for this issue as the hives that haven't crashed don't allow acid transactions.
Thanks,
Tom
Hi Ajit,
Lets not worry about Hive for this issue as the hives that haven't crashed don't allow acid transactions.
Thanks,
Tom
@Tom, @Nhi We are not able to batch import for BLOB data in an Interbase database. We have tried below code changes.
Added support of Interbase in usePreparedStatement method of ImportThread.java
Expression:
1.stmt.setBlob(idx, new SerialBlob(bytes));
Result : import --> Error: Row: 3 -- javax.sql.rowset.serial.SerialBlob cannot be cast to java.lang.Long.
2.stmt.setBytes(idx,bytes);
Result: import runs continuously.
3.ByteArrayInputStreamis= new ByteArrayInputStream(bytes);
stmt.setBinaryStream(idx,is,bytes.length);
Result: import runs continuously.
4.ByteArrayInputStreamis= new ByteArrayInputStream(bytes);
stmt.setBinaryStream(idx,is);
Result: Import runs successfully, but blob columns will have empty string.
Could you help us to find the correct way to batch import for BLOB data in an Interbase database?
@Tom, @Nhi We are not able to batch import for BLOB data in an Interbase database. We have tried below code changes.
Added support of Interbase in usePreparedStatement method of ImportThread.java
Expression:
1.stmt.setBlob(idx, new SerialBlob(bytes));
Result : import --> Error: Row: 3 -- javax.sql.rowset.serial.SerialBlob cannot be cast to java.lang.Long.
2.stmt.setBytes(idx,bytes);
Result: import runs continuously.
3.ByteArrayInputStreamis= new ByteArrayInputStream(bytes);
stmt.setBinaryStream(idx,is,bytes.length);
Result: import runs continuously.
4.ByteArrayInputStreamis= new ByteArrayInputStream(bytes);
stmt.setBinaryStream(idx,is);
Result: Import runs successfully, but blob columns will have empty string.
Could you help us to find the correct way to batch import for BLOB data in an Interbase database?
@Ajit: Regarding InterBase, I've experimented and it works with stmt.setBinaryStream(idx, is, length). There are other issues that needs to be tweaked in order for it to work. Please see InterBase-Blob-Import.patch. Here I did a prototype and was able to successfully import the export-blob.csv file. Please use this patch as you see fit, but be sure to test it first. Also note that you'll also need to make similar changes in CoreLibImportThread and ImportExcelImportThread.
@Ajit: Regarding InterBase, I've experimented and it works with stmt.setBinaryStream(idx, is, length). There are other issues that needs to be tweaked in order for it to work. Please see InterBase-Blob-Import.patch. Here I did a prototype and was able to successfully import the export-blob.csv file. Please use this patch as you see fit, but be sure to test it first. Also note that you'll also need to make similar changes in CoreLibImportThread and ImportExcelImportThread.
Functional Review:
I was trying to import CLOB into an Oracle database: Oracle 172.24.1.8 v12.2.0.2.0, Schema = TOM, Table = test_clob
When importing the export-small-blob.csv and export-small-blob.xlsx in BATCH mode, the content was imported with single quote characters around the CLOB values, which is incorrect. When I do the same import in FULL mode, it is imported correctly.
When importing the export-blob.csv file, the CLOB values are imported as TO_CLOB('ffd8fe...'), which is incorrect. The correct value should be ffd8fe...
I didn't test against other databases. Please be sure to test import of CLOB against other databases.
Functional Review:
I was trying to import CLOB into an Oracle database: Oracle 172.24.1.8 v12.2.0.2.0, Schema = TOM, Table = test_clob
When importing the export-small-blob.csv and export-small-blob.xlsx in BATCH mode, the content was imported with single quote characters around the CLOB values, which is incorrect. When I do the same import in FULL mode, it is imported correctly.
When importing the export-blob.csv file, the CLOB values are imported as TO_CLOB('ffd8fe...'), which is incorrect. The correct value should be ffd8fe...
I didn't test against other databases. Please be sure to test import of CLOB against other databases.
[Nhi] Looks good.
[Nhi] Looks good.
@Tom, @Nhi Teradata basebase was working fine for BLOB/CLOB datatype, but recently started throwing below error.
@Tom, @Nhi Teradata basebase was working fine for BLOB/CLOB datatype, but recently started throwing below error.
Hi Ajit,
Please add your test cases in the issue so I can debug them.
Thanks,
Tom
Hi Ajit,
Please add your test cases in the issue so I can debug them.
Thanks,
Tom
Hi Juhi,
I think this is because the database tom ran out of space. I increased the size and it now imports. Please make sure that you clean up after testing with the blob data. It can consume a lot of space.
Thanks,
Tom
Hi Juhi,
I think this is because the database tom ran out of space. I increased the size and it now imports. Please make sure that you clean up after testing with the blob data. It can consume a lot of space.
Thanks,
Tom
@nhi
I am unable to connect to "MySQL 172.24.1.199 v8.0". Error screenshot.
Hi Viraaj,
Try it now. For some reason it was stopped.
Thanks, Tom
Hi Viraaj,
Try it now. For some reason it was stopped.
Thanks, Tom
Hi Viraaj,
Only 50% of the automated test cases passed for me, even after multiple runs. Please see results here: https://idera.testrail.net/index.php?/runs/view/3047&group_by=cases:section_id&group_order=asc&group_id=20777
Hi Viraaj,
Only 50% of the automated test cases passed for me, even after multiple runs. Please see results here: https://idera.testrail.net/index.php?/runs/view/3047&group_by=cases:section_id&group_order=asc&group_id=20777
Hi All ,
1.) Done with Manual testing of this ticket.
2.) Added test-cases in Test-Rail mentioned in below link :-
3.) Results of these test cases (for binary , varbinary , blob datatypes) for all the supported databases are prevailed in the Excel sheet , use the below link to see the results.
'https://docs.google.com/spreadsheets/d/1WiDhxhzjLvXSw-h3GkiWKM-JRRbNa4g6GvbH_cQtjOc/edit?usp=sharing'
Thanks,
Juhi
Hi All ,
1.) Done with Manual testing of this ticket.
2.) Added test-cases in Test-Rail mentioned in below link :-
3.) Results of these test cases (for binary , varbinary , blob datatypes) for all the supported databases are prevailed in the Excel sheet , use the below link to see the results.
'https://docs.google.com/spreadsheets/d/1WiDhxhzjLvXSw-h3GkiWKM-JRRbNa4g6GvbH_cQtjOc/edit?usp=sharing'
Thanks,
Juhi
I am still not able to get all automated test cases to succeed: https://idera.testrail.net/index.php?/runs/view/3047&group_by=cases:section_id&group_order=asc&group_id=20777
I am still not able to get all automated test cases to succeed: https://idera.testrail.net/index.php?/runs/view/3047&group_by=cases:section_id&group_order=asc&group_id=20777
Hi Tom,
There is issue with Teradata. It has error like "No more room in database tom"
[TC] I cleaned up some space.
Hi Tom,
There is issue with Teradata. It has error like "No more room in database tom"
[TC] I cleaned up some space.
Hi @Nhi,
I have made some code updates in SVN #24105. Can you pls try it again ?
[Nhi] All test cases succeeded now.
Hi @Nhi,
I have made some code updates in SVN #24105. Can you pls try it again ?
[Nhi] All test cases succeeded now.
QE Comment:
We have verified the fix for import\export of BLOB datatype through ADS UI and Fluidshell both on ADS v20.6.0-rc-2 for following Database Servers:
Above databases are verified for import & Export of all types of datatypes supported by ADS for particular database servers in following platforms :
--> Windows
--> Ubuntu
--> Mac OS
Testcase results for same could be found at the below link:
https://idera.testrail.net/index.php?/cases/view/249516&group_by=cases:section_id&group_order=asc&group_id=21880
QE Comment:
We have verified the fix for import\export of BLOB datatype through ADS UI and Fluidshell both on ADS v20.6.0-rc-2 for following Database Servers:
Above databases are verified for import & Export of all types of datatypes supported by ADS for particular database servers in following platforms :
--> Windows
--> Ubuntu
--> Mac OS
Testcase results for same could be found at the below link:
https://idera.testrail.net/index.php?/cases/view/249516&group_by=cases:section_id&group_order=asc&group_id=21880
Issue #15687 |
Verified |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build ADS 20.6.0-dev-41-no-ofsc |
No time estimate |
1 issue link |
relates to #10563
Issue #10563Ability to edit BLOB/CLOB data in Table Editor |
Which databases?