我正在尝试通过 simba odbc 驱动程序使用 c# 从增量格式表中读取数据。增量格式表示例:https ://docs.delta.io/latest/quick-start.html#-create-a-table&language-python
已按照https://www.simba.com/products/Spark/doc/ODBC_InstallGuide/mac/content/odbc/configuring/drivermanager.htm中的说明下载并配置了 simba odbc
完成此配置后,我能够成功连接到 spark thrift 服务器。但是,我无法从增量格式表中读取数据。
using(dbConnection)
{
dbConnection.Open();
Console.WriteLine("Connection Open!");
OdbcCommand dbCommand = dbConnection.CreateCommand();
dbCommand.CommandText = "SELECT * FROM accnt LIMIT 10";
OdbcDataReader dbReader = dbCommand.ExecuteReader();
if(dbReader.HasRows)
{
while(dbReader.Read())
{
Console.WriteLine("{0}\t{1}\t{2}",
dbReader.GetString(0),dbReader.GetString(1), dbReader.GetString(2));
dbReader.GetString(1));
}
}
else
{
Console.WriteLine("No Rows Found.");
}
Console.WriteLine("Connection Close !");
}
错误消息是:
Unhandled exception. System.Data.Odbc.OdbcException (0x80131937): ERROR [HY000] [Simba][Hardy] (35) Error from server: error code: '0' error message: 'Error running query: java.lang.ClassNotFoundException: DELTA.DefaultSource'.
at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)
at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod)
at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader)
at System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Odbc.OdbcCommand.ExecuteReader()
at cdp_deltalake_poc.Program.Main(String[] args)