talgos1 edited a comment on pull request #2210:
URL: https://github.com/apache/iceberg/pull/2210#issuecomment-976203057


   > @talgos1, have you tried using a full file path as the source table?
   
   @rdblue 
   Using the `CALL` command, it expects the source to have same partition spec 
as destination (got an error the source has no partitions)
   
   Since my last comment, I succeeded doing that using the spark and java APIs 
and explicitly defining a synthetic SparkPartition for the file/path
   ```scala
   // Define the source file
   val uri = "/some/path/to/orc/file.orc"
   val format = "orc"
   val partitionSpec: util.Map[String, String] = Map("some_partition_key" -> 
"some_partition_value").asJava
   // Define a synthetic spark partition
   val sparkPartition = new SparkPartition(partitionSpec, uri,  format)
   
   // Do the add call for importing partitioned source table
   SparkTableUtil.importSparkPartitions(spark, Seq(sparkPartition).asJava, 
table, spec, stagingDir)
   ```
   
   WDYT?


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

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