qidaye opened a new issue #7926:
URL: https://github.com/apache/incubator-doris/issues/7926


   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### Version
   
   1ba20b1dbb4310c72f55f7834938e6ca40b21026
   
   ### What's Wrong?
   
   When using select into outfile, the error `Empty partition info` is 
occasionally reported.
   
   ### What You Expected?
   
   Query normally.
   
   ### How to Reproduce?
   
   1. Create table 
   
   ```sql
    CREATE TABLE `t1` (
     `id` int(11) NOT NULL DEFAULT "0" COMMENT "",
     `stream` text NOT NULL DEFAULT "" COMMENT ""
   ) ENGINE=OLAP
   DUPLICATE KEY(`id`, `stream`)
   COMMENT "OLAP"
   DISTRIBUTED BY HASH(`stream`) BUCKETS 1
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   "in_memory" = "false",
   "storage_format" = "V2"
   );
   ```
   
   2. Insert some data
   3. Select into outfile
   
   ```sql
   select * from t1  INTO OUTFILE 'hdfs://path_to_file' FORMAT AS CSV 
   PROPERTIES (
       "broker.name" = 'xxx', 
       "broker.username" = 'xxx', 
       "broker.password" = 'xxx', 
       "column_separator" = ',', 
       "max_file_size" = '1024M'
     );
   ```
   
   4. Query repeatly. 
   
   
   ### Anything Else?
   
   It is because `DataSink::create_data_sink` creates `ResultFileSink`, and 
then executes `sink->init()`.
   `ResultFileSink` inherits from `DataStreamSender`, but does not rewrite the 
`init` method, which causes the method of the parent class `DataStreamSender` 
to be called.
   Because the parent class is not initialized, resulting in `_part_type` value 
is random, and an error will be reported occasionally. .
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscr...@doris.apache.org

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



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

Reply via email to