xushiyan commented on issue #6185:
URL: https://github.com/apache/hudi/issues/6185#issuecomment-1295927804

   this is mostly due to setup and config issue. I've tried the following 
locally and it worked with latest master version.
   
   ```shell
   # download derby and spark and install to /opt
   export DERBY_HOME=/opt/db-derby-10.14.1.0-bin
   export SPARK_HOME=/opt/spark-3.1.3-bin-hadoop3.2
   
   # copy derby driver jars to spark
   cp $DERBY_HOME/lib/{derby,derbyclient}.jar $SPARK_HOME/jars/
   
   # start derby local server
   $DERBY_HOME/bin/startNetworkServer -h 0.0.0.0
   
   # start spark thrift server
   $SPARK_HOME/sbin/start-thriftserver.sh \
   --jars hudi-spark3.1-bundle_2.12-0.13.0-SNAPSHOT.jar \
   --conf spark.serializer=org.apache.spark.serializer.KryoSerializer \
   --conf 
spark.sql.extensions=org.apache.spark.sql.hudi.HoodieSparkSessionExtension \
   --conf spark.sql.warehouse.dir=/tmp/hudi/hive/warehouse \
   --hiveconf hive.aux.jars.path=hudi-hadoop-mr-bundle-0.13.0-SNAPSHOT.jar \
   --hiveconf hive.metastore.warehouse.dir=/tmp/hudi/hive/warehouse \
   --hiveconf hive.metastore.schema.verification=false \
   --hiveconf datanucleus.schema.autoCreateAll=true \
   --hiveconf 
javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.ClientDriver \
   --hiveconf 
javax.jdo.option.ConnectionURL=jdbc:derby://localhost:1527/default;create=true \
   
   # start beeline to query
   $SPARK_HOME/bin/beeline \
   --hiveconf hive.input.format=org.apache.hudi.hadoop.HoodieParquetInputFormat 
\
   -u jdbc:hive2://localhost:10000/default;user=${USER};password=
   
   ```
   
   Then run query
   
   ```sql
   create table mytable (
     id bigint,
     name string,
     ts bigint,
     dt string,
     hh string
   ) using hudi
   tblproperties (
     type = 'cow',
     primaryKey = 'id',
     preCombineField = 'ts'
    )
   partitioned by (dt, hh)
   location '/tmp/mytable';
   ```
   
   it showed the created table
   
   ```
   0: jdbc:hive2://localhost:10000/default> show tables;
   +-----------+------------+--------------+
   | database  | tableName  | isTemporary  |
   +-----------+------------+--------------+
   | default   | mytable    | false        |
   +-----------+------------+--------------+
   3 rows selected (0.059 seconds)
   ```
   
   will proceed to close this now.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to