rangareddy commented on issue #12114:
URL: https://github.com/apache/hudi/issues/12114#issuecomment-2419054167

   To disable metadata while performing any operation with `spark.sql()`, we 
need to configure it as follows:
   
   ```scala
   spark.sql("SET hoodie.metadata.enable=false")
   ```
   
   **Sample Code:**
   
   ```scala
     // spark.sql("SET hoodie.metadata.enable=false")
   
     spark.sql(
       """
         |CREATE TABLE IF NOT EXISTS t_test (
         |  `id` VARCHAR(20),
         |  `name` VARCHAR(10),
         |  `age` INT,
         |  `ts` Long
         |) USING HUDI TBLPROPERTIES (primaryKey = 'id,name', preCombineField = 
'ts')
         | LOCATION '/tmp/hudi/t_test'
       """.stripMargin)
   
     spark.sql("INSERT INTO t_test VALUES (1, \"hello\", 42,  1695159649087)")
   
     spark.sql("SELECT * FROM t_test").show(false)
   ```


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