MATLAB Answers

Access Apache Hive using ODBC driver

조회 수: 9(최근 30일)
Harry Cho
Harry Cho 5 Aug 2020
댓글: Harry Cho 6 Aug 2020
Is it possible to send SQL query to Apache Hive through ODBC and get the result in Matlab workspace? In Database toolbox, all examples are RDBMS,not Hive in HDFS. Thank you for your help in advance.

  댓글 수: 0

댓글을 달려면 로그인하십시오.

채택된 답변

Kojiro Saito
Kojiro Saito 6 Aug 2020
I've tested Hive access via JDBC Driver, but not ODBC Driver yet, but I think possibly, yes.
First, 64 bit ODBC Driver is requied.
Next, configure ODBC data source in Database Toolbox. And I think you can access to Hive
datasource = 'Hive'; % The name of datasource specified in configureODBCDataSource
username = 'XXX';
password = 'YYY';
conn = database(datasource, username, password);
selectquery = 'SELECT TOP 10 * FROM TABLENAME';
data = select(conn,selectquery);

  댓글 수: 1

Harry Cho
Harry Cho 6 Aug 2020
Thank you! ODBC driver works.

댓글을 달려면 로그인하십시오.

추가 답변(0개)

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by