Spark SQL ODBC Connection not connected -
i have build spark source using following command
mvn -pyarn -phadoop-2.5 -dhadoop.version=2.5.2 -phive -phive-1.1.0 -phive-thriftserver -dskiptests clean package
i have started thrift server using following command
spark-submit --class org.apache.spark.sql.hive.thriftserver.hivethriftserver2 --master local[*] file:///c:/spark-1.3.1/sql/hive-thriftserver/target/spark-hive-thriftserver_2.10-1.3.1.jar
connected thriftserver in beeline using following command
jdbc:hive2://localhost:10000
created table named people using following query
create table people(name string); load data local inpath ‘c:\spark-1.3.1\examples\src\main\resources\people.txt’ overwrite table people;
how read table c# application using odbc connection or thrift library?
i have use following code snippet read table using c# code generated thrift , thrift dll
console.writeline("thrift hive server spark sql connection...."); tsocket hivesocket = new tsocket("localhost", 10000); tbinaryprotocol protocol =new tbinaryprotocol(hivesocket); thrifthive.client client = new thrifthive.client(protocol); if (!hivesocket.isopen) { hivesocket.open(); } console.writeline("thrift server connected"); client.execute("select * people1");
but can not execute query.
it not throwing error or exception because there no error , processing worked. need retrieve results using client.fetchall().
Comments
Post a Comment