Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
When I load an empty table, Power BI throw exception like "OLE DB or ODBC error: Unable to cast object of type 'EmptyColumn' to type Microsoft.OldDb.Column".
It would run okay when the table is not empty.
And here are the part of logs:
[DEBUG][2018-01-24.17:39:07]RestFetchMoreResults called, AthenaClient:00000258E45D2AE0
[DEBUG][2018-01-24.17:39:07]AthenaClient::fetchMoreResult called
[DEBUG][2018-01-24.17:39:07]AthenaClient::CreateColumnDescriptor called, Label:osname, CataLogName:hive, SchemaName:, TableName:, ColumnName:osname, ColumnType:varchar
[DEBUG][2018-01-24.17:39:07]RestFetchMoreResults returned, ColumnCount:1, RowCount:0
[DEBUG][2018-01-24.17:39:07]SQLMoreResults returned, RetCode:SQL_NO_DATA
[DEBUG][2018-01-24.17:39:07]SQLFreeHandle called, HandleType:SQL_HANDLE_STMT, Handle:00000258E4573830
[DEBUG][2018-01-24.17:40:13]SQLGetInfoW called, InfoType:SQL_MAX_CONCURRENT_ACTIVITIES, BufferLength:2
[DEBUG][2018-01-24.17:40:13]SQLGetInfoW returned
[DEBUG][2018-01-24.17:40:13]SQLDisconnect called
[DEBUG][2018-01-24.17:40:13]SQLDisconnect returned
[DEBUG][2018-01-24.17:40:13]SQLFreeHandle called, HandleType:SQL_HANDLE_DBC, Handle:0000021DDE102190
[DEBUG][2018-01-24.17:40:13]SQLFreeHandle called, HandleType:SQL_HANDLE_ENV, Handle:0000021DDE127060
Solved! Go to Solution.
Solved, it's because SQLExecute should return SQL_SUCCESS instead of return SQL_NO_DATA when load empty table.
You may check code in The Advanced Editor.
The code is no difference.
shared test1 = let
Source = ThriveConnector.Database("us-west-2"),
thrive_mobiledevelopment_Database = Source{[Name="thrive_mobiledevelopment",Kind="Database"]}[Data],
test1_Table = thrive_mobiledevelopment_Database{[Name="test1",Kind="Table"]}[Data]
in
test1_Table;
And power bi know it's an empty table. And here shows 2 tables:
But it would throw error when load the data. And if you return to main window, you can only see 1 table.
What happened to the test1 table?
(1/26/2018 10:53:29 AM) Message: Started listening on TCPIP: Status = ListenToPortSuccess, ComputerName = DESKTOP-FR15DM5, PhysicalNetBIOSName = DESKTOP-FR15DM5, ListenOnIP = ::1, Port = 4518, ProtocolType = IP6 (Source: \\?\C:\Users\QQQ\AppData\Local\Microsoft\Power BI Desktop\AnalysisServicesWorkspaces\AnalysisServicesWorkspace722381719\Data\msmdsrv.log, Type: 1, Category: 289, Event ID: 0x4121001C)
(1/26/2018 10:53:29 AM) Message: Started listening on TCPIP: Status = ListenToPortSuccess, ComputerName = DESKTOP-FR15DM5, PhysicalNetBIOSName = DESKTOP-FR15DM5, ListenOnIP = 127.0.0.1, Port = 4518, ProtocolType = IP4 (Source: \\?\C:\Users\QQQ\AppData\Local\Microsoft\Power BI Desktop\AnalysisServicesWorkspaces\AnalysisServicesWorkspace722381719\Data\msmdsrv.log, Type: 1, Category: 289, Event ID: 0x4121001C)
(1/26/2018 10:53:29 AM) Message: Software usage metrics are disabled. (Source: \\?\C:\Users\QQQ\AppData\Local\Microsoft\Power BI Desktop\AnalysisServicesWorkspaces\AnalysisServicesWorkspace722381719\Data\msmdsrv.log, Type: 1, Category: 289, Event ID: 0x4121000E)
(26/01/2018 10:53:29 AM) Message: The resource file 'msmdsrvi.rll' for locale '5129' could not be loaded. Switching to US English (1033) if available. (Source: \\?\C:\Users\QQQ\AppData\Local\Microsoft\Power BI Desktop\AnalysisServicesWorkspaces\AnalysisServicesWorkspace722381719\Data\msmdsrv.log, Type: 3, Category: 289, Event ID: 0xC1210019)
(1/26/2018 11:00:46 AM) Message: OLE DB or ODBC error: Unable to cast object of type 'EmptyColumn' to type 'Microsoft.OleDb.Column'.. (Source: \\?\C:\Users\QQQ\AppData\Local\Microsoft\Power BI Desktop\AnalysisServicesWorkspaces\AnalysisServicesWorkspace722381719\Data\msmdsrv.log, Type: 3, Category: 289, Event ID: 0xC1210003)
Solved, it's because SQLExecute should return SQL_SUCCESS instead of return SQL_NO_DATA when load empty table.
Glad to hear that. You may help accept the solution above. Your contribution is highly appreciated.
User | Count |
---|---|
139 | |
113 | |
103 | |
73 | |
63 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |