Skip to content

Commit

Permalink
[AD-644] Tableau show metadata (#55)
Browse files Browse the repository at this point in the history
* [AD-604] Query execution adaption

* [AD-591] update word doc for SetResultsetMeta

* [AD-591] refactor changes

* [AD-591] implement read jdbc metadata function

* [AD-591] populate resultMeta for DataQuery class

* create function ReadJdbcColumnMetadataVector, which calls ReadJdbcMetadata

* [AD-591] fix mac build error

* fix by removing extra qualification on member 'ReadJdbcColumnMetadataVector'

* [AD-591] change TestSQLNumResultColsStub test

* since resultMeta is now implemented, the correct number of SQLcolumns count will be outputted.
* there are 13 columns in api_robustness_test_001.json, so Boost check is set to 13.

* [AD-591] update test name to avoid duplicate

* [AD-591] remove unneeded comments

* [AD-591] add copy of original ignite code for reference

* [AD-591] make PowerBI show metadata

* loading resultMeta when MakeRequestExecute is called will make PowerBI show the metadata.

* [AD-591] add output for IgnitError in MakeRequestResultsetMeta

* [AD-591] remove comments and old ignite code

* [AD-591] modify MakeRequestExecute to avoid duplicate code

* I am assuming that MakeRequestExecute will likely also call GetMqlQueryContext, so I am modifying the code to make it easier to integrate with AD-604 (implement MakeRequestExecute) later on

* [AD-644] add log messages and notes

* [AD-644] set SQL_IDENTIFIER_QUOTE_CHAR to double quotes

* Setting SQL_IDENTIFIER_QUOTE_CHAR to double quotes makes the queries sent from BI tools have double quotes added around the identifiers.
* This fix is specifically for Tableau, so Tableau can retrieve data from our ODBC Driver. PowerBI and Qlik (Qlik Sense Desktop) do not require this fix to retrieve metadata. But having this fix does not affect the retrieval of metadata on PowerBI / Qlik either.

Co-Authored-By: andiem-bq <[email protected]>

* [AD-644] fix rowArraySize bug

* It originated from Ignite's source code, SQLSetStmtAttr can be called to set the row array size, but when GetStmtAttr is called by Tableau, row array size = 1 is sent, which probably confuses Tableau and causes issues.
* when internal rowArraySize variable value mismatches the value from SQLGetStmtAttr, the Tableau calls SQLBindCol with index value out of bound (e.g., for our case, the last index value is 5, but when rowArratSize is not returned to val, Tableau sends SQLBindCol with index value all the way up to 14 for some unknown reason, and causes our ODBC driver to crash and disconnect)

* Revert "[AD-644] add log messages and notes"

This reverts commit a5be3a8.

* [AD-644] logs

* commit logs to show how the logs are done, and my thinking process, will revert the commit immediately

* Revert "[AD-644] logs"

This reverts commit ea520e1.

* [AD-644] nit remove empty new line

* [AD-644] undo remove new line

* [AD-644] remove empty space
  • Loading branch information
alinaliBQ authored Mar 25, 2022
1 parent 48edad5 commit bbb0c0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/odbc/src/config/connection_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ ConnectionInfo::ConnectionInfo(const Configuration& config)
// quoted (delimited) identifier in SQL statements. Identifiers passed as
// arguments to ODBC functions do not have to be quoted. If the data source
// does not support quoted identifiers, a blank is returned.
strParams[SQL_IDENTIFIER_QUOTE_CHAR] = "";
strParams[SQL_IDENTIFIER_QUOTE_CHAR] = "\"";
#endif // SQL_IDENTIFIER_QUOTE_CHAR

#ifdef SQL_CATALOG_NAME_SEPARATOR
Expand Down
2 changes: 1 addition & 1 deletion src/odbc/src/statement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ SqlResult::Type Statement::InternalGetAttribute(int attr, void* buf, SQLINTEGER,
case SQL_ATTR_ROW_ARRAY_SIZE: {
SQLINTEGER* val = reinterpret_cast< SQLINTEGER* >(buf);

*val = static_cast< SQLINTEGER >(1);
*val = static_cast< SQLINTEGER >(rowArraySize);

if (valueLen)
*valueLen = SQL_IS_INTEGER;
Expand Down

0 comments on commit bbb0c0f

Please sign in to comment.