You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "tsreaper (via GitHub)" <gi...@apache.org> on 2023/11/15 07:57:16 UTC

[PR] [core] Introduce RawTableFile public API to indicate files which can be read without merging [incubator-paimon]

tsreaper opened a new pull request, #2319:
URL: https://github.com/apache/incubator-paimon/pull/2319

   ### Purpose
   
   Currently many C++ big data systems (for example StarRocks) have supported Paimon. However as Paimon's data files use the LSM tree structure, these data files must be merged before reading, and these C++ systems have to use Paimon's Java reader. This affects the performance a lot.
   
   However, under certain circumstances (for example, when a table is fully compacted) the data files can be read without merging. This PR introduces a new public API called `RawTableFile` to indicate such files. API users can try to extract `RawTableFile` from `DataSplit` and directly read the files with their own very fast file reader.
   
   ### Tests
   
   * `DataSplitTest`.
   
   ### API and Format
   
   Yes. It introduces a new public API.
   
   ### Documentation
   
   No. This change should only be used by other big data system developers, not users.
   


-- 
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-unsubscribe@paimon.apache.org

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


Re: [PR] [core] Introduce RawTableFile public API to indicate files which can be read without merging [incubator-paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #2319:
URL: https://github.com/apache/incubator-paimon/pull/2319#discussion_r1393867881


##########
paimon-core/src/main/java/org/apache/paimon/table/source/DataSplit.java:
##########
@@ -89,6 +97,51 @@ public long rowCount() {
         return rowCount;
     }
 
+    @Override
+    public Optional<List<RawTableFile>> getRawTableFiles(Table table) {

Review Comment:
   I think we can just introduce `Table.convertToRawFiles(Split split)`.



##########
paimon-core/src/main/java/org/apache/paimon/table/source/RawTableFile.java:
##########
@@ -0,0 +1,72 @@
+/*
+ * 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.table.source;
+
+import org.apache.paimon.annotation.Public;
+
+import java.util.Objects;
+
+/**
+ * A data file from the table which can be read directly without merging.
+ *
+ * @since 0.6.0
+ */
+@Public
+public class RawTableFile {

Review Comment:
   `RawFile`?



##########
paimon-core/src/main/java/org/apache/paimon/table/source/RawTableFile.java:
##########
@@ -0,0 +1,72 @@
+/*
+ * 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.table.source;
+
+import org.apache.paimon.annotation.Public;
+
+import java.util.Objects;
+
+/**
+ * A data file from the table which can be read directly without merging.
+ *
+ * @since 0.6.0
+ */
+@Public
+public class RawTableFile {
+
+    private final String path;
+    private final long offset;
+    private final long length;
+
+    public RawTableFile(String path, long offset, long length) {

Review Comment:
   Add schema ID.



##########
paimon-core/src/main/java/org/apache/paimon/table/source/RawTableFile.java:
##########
@@ -0,0 +1,72 @@
+/*
+ * 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.table.source;
+
+import org.apache.paimon.annotation.Public;
+
+import java.util.Objects;
+
+/**
+ * A data file from the table which can be read directly without merging.
+ *
+ * @since 0.6.0
+ */
+@Public
+public class RawTableFile {
+
+    private final String path;
+    private final long offset;
+    private final long length;
+
+    public RawTableFile(String path, long offset, long length) {

Review Comment:
   add `String format`.



-- 
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-unsubscribe@paimon.apache.org

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


Re: [PR] [core] Introduce RawFile public API to indicate files which can be read without merging [incubator-paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #2319:
URL: https://github.com/apache/incubator-paimon/pull/2319#discussion_r1395448511


##########
paimon-core/src/main/java/org/apache/paimon/table/source/RawFile.java:
##########
@@ -0,0 +1,96 @@
+/*
+ * 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.table.source;
+
+import org.apache.paimon.CoreOptions;
+import org.apache.paimon.annotation.Public;
+
+import java.util.Objects;
+
+/**
+ * A data file from the table which can be read directly without merging.
+ *
+ * @since 0.6.0
+ */
+@Public
+public class RawFile {
+
+    private final String path;
+    private final long offset;
+    private final long length;
+    private final CoreOptions.FileFormatType format;

Review Comment:
   just String? It is not so good to expose `CoreOptions.FileFormatType`.



-- 
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-unsubscribe@paimon.apache.org

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


Re: [PR] [core] Introduce RawFile public API to indicate files which can be read without merging [incubator-paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #2319:
URL: https://github.com/apache/incubator-paimon/pull/2319


-- 
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-unsubscribe@paimon.apache.org

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