Copilot commented on code in PR #6296:
URL: https://github.com/apache/paimon/pull/6296#discussion_r2371164527
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/FormatCatalogTable.java:
##########
@@ -98,7 +98,7 @@ public Map<String, String> getOptions() {
}
});
if (options.containsKey("field-delimiter")) {
- cachedOptions.put("csv.field-delimiter", "field-delimiter");
+ cachedOptions.put("csv.field-delimiter",
options.get("field-delimiter"));
Review Comment:
The original code was incorrectly putting the key 'field-delimiter' as the
value instead of the actual field delimiter value from options. This fix
correctly retrieves the value using `options.get('field-delimiter')`.
##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/PaimonFormatTableScanBuilder.scala:
##########
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.spark
+
+import org.apache.paimon.CoreOptions
+import org.apache.paimon.predicate.Predicate
+import org.apache.paimon.table.FormatTable
+import org.apache.paimon.table.source.Split
+
+import org.apache.spark.sql.connector.metric.{CustomMetric, CustomTaskMetric}
+import org.apache.spark.sql.connector.read.{Batch, Scan}
+import org.apache.spark.sql.types.StructType
+
+import scala.collection.JavaConverters._
+
+/** ScanBuilder for FormatTable that supports basic scan operations. */
Review Comment:
[nitpick] The class should have a scaladoc comment explaining its purpose
and relationship to FormatTable, especially since it's a key component of the
new format table reading functionality.
```suggestion
/**
* A ScanBuilder implementation for {@link FormatTable} that supports basic
scan operations.
*
* <p>This class is a key component of the new format table reading
functionality in Paimon Spark.
* It is responsible for constructing a {@link Scan} for a given {@link
FormatTable}, applying
* required schema and predicate pushdown as needed. The builder leverages
the capabilities of
* {@code FormatTable} to efficiently plan and execute scans over tables
with various formats.
*
* <p>Relationship to {@code FormatTable}: This builder is specifically
designed to work with
* {@code FormatTable} instances, enabling Spark to read data from tables
that support different
* file formats and scan optimizations provided by the Paimon storage engine.
*/
```
--
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]