soumilshah1995 commented on issue #9764:
URL: https://github.com/apache/hudi/issues/9764#issuecomment-1730155816

   Tried this code it Creates Hudi directory cannot see parquet files 
   
   ```
   
   
   
   from pyflink.table import EnvironmentSettings, TableEnvironment
   import os
   from faker import Faker
   
   # Create a batch TableEnvironment
   env_settings = EnvironmentSettings.in_batch_mode()
   table_env = TableEnvironment.create(env_settings)
   
   # Get the current working directory
   CURRENT_DIR = os.getcwd()
   
   # Define a list of JAR file names you want to add
   jar_files = [
       # "hudi-flink-bundle_2.12-0.10.1.jar",
       "flink-s3-fs-hadoop-1.16.1.jar",
       "hudi-flink1.16-bundle-0.13.0.jar",
       "flink-sql-connector-kinesis-1.16.1.jar"
   ]
   
   # Build the list of JAR URLs by prepending 'file:///' to each file name
   jar_urls = [f"file:///{CURRENT_DIR}/{jar_file}" for jar_file in jar_files]
         
   table_env.get_config().get_configuration().set_string(
       "pipeline.jars",
       ";".join(jar_urls)
   )
   
   
   hudi_output_path = 'file://' + os.path.join(os.getcwd(), 'output')
   
   #hudi_output_path = 's3a://datateam-sandbox-qa-demo/tmp/'
   
   hudi_sink = f"""
   CREATE TABLE t1(
       uuid VARCHAR(20) PRIMARY KEY NOT ENFORCED,
       name VARCHAR(10),
       age INT,
       ts TIMESTAMP(3),
       `partition` VARCHAR(20)
   )
   PARTITIONED BY (`partition`)
   WITH (
       'connector' = 'hudi',
       'path' = '{hudi_output_path}' ,
       'table.type' = 'MERGE_ON_READ' 
       
   );
   """
   
   
   table_env.execute_sql(hudi_sink)
   
   insert_into_hudi_sink_query= """
   INSERT INTO t1 VALUES
     ('id1','Danny',23,TIMESTAMP '1970-01-01 00:00:01','par1'),
     ('id2','Stephen',33,TIMESTAMP '1970-01-01 00:00:02','par1'),
     ('id3','Julian',53,TIMESTAMP '1970-01-01 00:00:03','par2'),
     ('id4','Fabian',31,TIMESTAMP '1970-01-01 00:00:04','par2'),
     ('id5','Sophia',18,TIMESTAMP '1970-01-01 00:00:05','par3'),
     ('id6','Emma',20,TIMESTAMP '1970-01-01 00:00:06','par3'),
     ('id7','Bob',44,TIMESTAMP '1970-01-01 00:00:07','par4'),
     ('id8','Han',56,TIMESTAMP '1970-01-01 00:00:08','par4');
   """
   
   table_env.execute_sql(insert_into_hudi_sink_query)
   ```
   
![image](https://github.com/apache/hudi/assets/39345855/bbbd3eab-f87d-4542-b581-92630b441e29)
   
   


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