TranHuyTiep commented on issue #8340:
URL: https://github.com/apache/hudi/issues/8340#issuecomment-1492861891

   > can you provide a simple reproduce step, like `code` or `sql`
   
   Here is my code
   
   `# -*- coding: utf-8 -*-
   from pyspark.conf import SparkConf
   from pyspark.sql import SparkSession
   
   if __name__ == '__main__':
       print("_____________Run______________")
   
       spark_conf = SparkConf()
       spark_conf.set("spark.jars.packages", 
"org.apache.hudi:hudi-spark3.2-bundle_2.12:0.13.0,org.apache.spark:spark-avro_2.12:3.3.1")
       spark_conf.set("spark.serializer", 
"org.apache.spark.serializer.KryoSerializer")
       spark_conf.set("spark.sql.hive.convertMetastoreParquet", "false")
       spark_conf.set("spark.rdd.compress", "true")
   
       sparkSession = (SparkSession
                       .builder
                       .appName('read_hudi')
                       .config(conf=spark_conf)
                       .getOrCreate())
   
       file_path = "hdfs://hdfs_host:9000/data/dwd/trans_event"
   
       # READ HUDI
       df_load = sparkSession.read.format("org.apache.hudi").load(
           file_path, inferSchema=True,
           header=True
       )
   
       # READ
       df_load.createOrReplaceTempView("trans_event")
       query_e34_trans_raw = """
           SELECT transaction_data.profile_id FROM trans_event limit 10
       """
       df_load_profile_trans = sparkSession.sql(sqlQuery=query_e34_trans_raw)
       df_load_profile_trans.printSchema()
       df_load_profile_trans.show(10)
       sparkSession.stop()
   
       print("_____________End______________")
   
   `


-- 
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