knowxyz opened a new issue, #12802:
URL: https://github.com/apache/iceberg/issues/12802

   from pyspark.sql import SparkSession
   spark1 = SparkSession.builder \
       .appName("IcebergSave") \
       .config("spark.sql.extensions", 
"org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions") \
       .config("spark.sql.catalog.abccatalog", 
"org.apache.iceberg.spark.SparkCatalog") \
       .config("spark.sql.catalog.abccatalog.type", "hadoop") \
       .config("spark.jars.packages", 
"org.apache.iceberg:iceberg-spark-runtime-3.5_2.12:1.4.3") \
       .config("spark.sql.catalog.abccatalog.warehouse", 
f"{mount_point}/mywarehouse").getOrCreate()
   
spark1.conf.set(f"fs.azure.account.key.{storage_account_name}.blob.core.windows.net",
 storage_account_key)
   spark1.conf.set("spark.sql.parquet.enableVectorizedReader", "false")
   spark1.conf.set("spark.sql.iceberg.vectorization.enabled", "false")
   df = < read data from some source>
   savetable ="abccatalog.default.table1"
   # Write to Iceberg table with partitioning
   df.createOrReplaceTempView("tempview1")
   
   # Query the temporary view using SQL
   resultdf1 = spark1.sql("SELECT * FROM tempview1")
   # only iceberg here
   resultdf1.write.format("iceberg").mode("overwrite").saveAsTable(savetable)
   dfread = 
spark.read.format("org.apache.iceberg.spark.source.IcebergSource").option("header",
 "true").load(savetable)
   show = dfread.show()
   print(show)
   
![Image](https://github.com/user-attachments/assets/cd606a49-89cf-4acc-b74e-e10f6b66ca56)
   


-- 
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: issues-unsubscr...@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to