github-actions[bot] commented on code in PR #69526:
URL: https://github.com/apache/doris/pull/69526#discussion_r4366426050


##########
fe/fe-core/src/main/java/org/apache/doris/tablefunction/LocalTableValuedFunction.java:
##########
@@ -137,6 +140,28 @@ private void getFileListFromBackend() throws 
AnalysisException {
         }
     }
 
+    /** Apply LOCAL admission to sinks that select the built-in local JNI 
writer as well. */
+    public static void checkSinkEnabled(String tvfName, Map<String, String> 
properties) {
+        String writerClass = properties.getOrDefault("writer_class", "");
+        // JNI consumes a C string, and ScannerLoader accepts slash-separated 
class names.
+        int nul = writerClass.indexOf('\0');
+        if (nul >= 0) {
+            writerClass = writerClass.substring(0, nul);
+        }
+        if ("local".equalsIgnoreCase(tvfName)
+                || 
"org.apache.doris.writer.LocalFileJniWriter".equals(writerClass.replace('/', 
'.'))) {

Review Comment:
   [P1] Gate the supported local writer factory identifier
   
   With `enable_local_tvf=false`, `INSERT INTO 
s3('file_path'='/tmp/local_gate_', 'format'='csv', 
'writer_class'='java-writer:local-file') SELECT 1` passes both admission 
checks. At this head, `create_tvf_format_transformer` requires 
`<plugin>:<factory>` and resolves `java-writer:local-file` to 
`LocalFileWriterFactory`, which creates `LocalFileJniWriter`; its 
`openInternal` creates/truncates the supplied local path. The JNI branch skips 
the nominal S3 filesystem, and global LOAD is sufficient to execute the 
command. Comparing an obsolete Java class name therefore leaves local writes 
available under the default-off policy. Gate the effective plugin/factory 
identifier and test this accepted spelling in INSERT/EXPLAIN and direct sink 
binding; the added class-name tests exercise inputs the current BE rejects. 
This is distinct from the earlier nominal LOCAL-sink issue.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to