davidzollo commented on issue #8388:
URL: https://github.com/apache/seatunnel/issues/8388#issuecomment-2863329410

   
   LocalFile batch to PostgreSQL
   
   ---
   
   ```
   env {
       "job.name"="testfile"
       "job.mode"="BATCH"
   }
   source {
       LocalFile {
               file_filter_pattern = "BDC_ceshi1298.csv" 
               file_format_type = "CSV" 
               data_save_mode  = "CSV" 
               delimiter   = ","
               read_columns  = ["n1_b_ak", "n2_bak", "amm_bak", "remarks"] 
               schema {
                   columns=[
                       {
                           name="n1_b_ak"
                           type=string
                           "nullable"=false
                       },
                       {
                           name="n2_bak"
                           type=string
                           "nullable"=false
                       },
                       {
                           name="amm_bak"
                           type=string
                           "nullable"=false
                       },
                       {
                           name=remarks
                           type=string
                           "nullable"=false
                       }
                       ]
                   }
               path="/data/whale_ops/flie/"
               "skip_header_row_number"="1"
               encoding= "UTF-8" 
       }
   }
   sink { 
     Jdbc { 
         driver = "org.postgresql.Driver" 
         url = "jdbc:postgresql://xxx:5432/qa_sink" 
         user = "postgres" 
         password = "postgres" 
         generate_sink_sql = "true" 
         enable_upsert  = "true" 
         is_primary_key_updated  = "false" 
         schema_save_mode  = "CREATE_SCHEMA_WHEN_NOT_EXIST" 
         database  = "qa_sink" 
         table="public.testtable" 
         data_save_mode = "APPEND_DATA" 
     } 
   }
   ```
   
   
   
[BDC_ceshi1298.csv](https://github.com/user-attachments/files/20104868/BDC_ceshi1298.csv)


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