You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/11/23 07:00:23 UTC

[GitHub] [incubator-doris] qidaye commented on issue #7078: [Bug] ES Extern Table Crash

qidaye commented on issue #7078:
URL: https://github.com/apache/incubator-doris/issues/7078#issuecomment-976209643


   I can not reproduce this bug. 
   
   Here is my steps to reproduce:
   
   1. Turn on ASAN before build BE, adding `export BUILD_TYPE=ASAN` in `custom_env.sh`
   2. Create index in ES
   ```
   curl -u root:root -sXPUT -H 'Content-Type:application/json' http://xxxx/doris_external_data_not_null?pretty -d '{
     "mappings" : {
         "properties" : {
           "id_int" : {
             "type" : "long"
           },
           "id_int1000" : {
             "type" : "long"
           },
           "id_tinyint" : {
             "type" : "integer"
           },
           "id_smallint" : {
             "type" : "integer"
           },
           "id_float" : {
             "type" : "float"
           },
           "id_double" : {
             "type" : "double"
           },
           "id_char" : {
             "type" : "text"
           },
           "id_varchar" : {
             "type" : "text"
           },
           "id_varchar_int" : {
             "type" : "text"
           },
           "id_varchar_date" : {
             "type" : "text"
           },
           "id_varchar_datetime" : {
             "type" : "text"
           },
           "id_date" : {
             "type" : "date",
             "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
           },
           "id_datetime" : {
             "type" : "date",
             "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
           },
           "id_decimal" : {
             "type" : "text"
           },
           "id_decimal10" : {
             "type" : "text"
           },
           "id_boolean" : {
             "type" : "boolean"
           }
         }
       }
   }'
   ```
   3. Index docs to the index 
   ``` 
   curl -u root:root -sXPUT -H 'Content-Type:application/json' http://xxxx/doris_external_data_not_null/_doc/1?pretty -d '{"id_int":11, "id_int1000":11, "id_tinyint":1, "id_smallint":1, "id_float":1.0, "id_double":1.0, "id_char":"aa", "id_varchar":"aa", "id_varchar_int":"1", "id_varchar_date":"2020-10-01", "id_varchar_datetime":"2020-10-10 10:10:10", "id_date":"2020-10-10", "id_datetime":"2020-10-10 10:10:10", "id_decimal":"222", "id_decimal10":"222", "id_boolean":true}'
   
   curl -u root:root -sXPUT -H 'Content-Type:application/json' http://xxxx/doris_external_data_not_null/_doc/2?pretty -d '{"id_int":null, "id_int1000":null, "id_tinyint":null, "id_smallint":null, "id_float":null, "id_double":null, "id_char":null, "id_varchar":null, "id_varchar_int":null, "id_varchar_date":null, "id_varchar_datetime":null, "id_date":null, "id_datetime":null, "id_decimal":null, "id_decimal10":null, "id_boolean":null}'
   ```
   4. Create external ES table in Doris 
   ```sql
   
   CREATE EXTERNAL TABLE external_es_table_without_null( 
     id_int int(11) NOT NULL COMMENT "", 
     id_int1000 int(11) NOT NULL COMMENT "", 
     id_tinyint tinyint(4) NOT NULL COMMENT "", 
     id_smallint smallint(6) NOT NULL COMMENT "", 
     id_float float NOT NULL COMMENT "", 
     id_double double NOT NULL COMMENT "", 
     id_char char(255) NOT NULL COMMENT "", 
     id_varchar varchar(65533) NOT NULL COMMENT "", 
     id_varchar_int varchar(65533) NOT NULL COMMENT "", 
     id_varchar_date varchar(65533) NOT NULL COMMENT "", 
     id_varchar_datetime varchar(65533) NOT NULL COMMENT "", 
     id_date date NOT NULL COMMENT "", 
     id_datatime datetime NOT NULL COMMENT "", 
     id_decimal varchar(65533) NOT NULL COMMENT "", 
     id_decimal10 varchar(65533) NOT NULL COMMENT "", 
     id_boolean boolean NOT NULL COMMENT "" 
   ) 
   ENGINE=ELASTICSEARCH COMMENT "ELASTICSEARCH" 
   PROPERTIES ( 
     "hosts" = "http://xxxx", 
     "user" = "root", 
     "password" = "root", 
     "index" = "doris_external_data_not_null", 
     "type" = "_doc", 
     "transport" = "http", 
     "enable_docvalue_scan" = "true", 
     "max_docvalue_fields" = "20", 
     "enable_keyword_sniff" = "true" 
   );
   ```
   5. Select ES table in Doris 
   ```sql
   select * from external_es_table_without_null as ref_0 where ( cast(id_int as string) is NULL);
   
   select * from external_es_table_without_null as ref_0 where ( if( cast( case when ref_0.id_char > ref_0.id_varchar_int then false else false end as BOOLEAN ), cast(ref_0.id_tinyint as INT), cast(ref_0.id_boolean as INT) ) is NULL );
   ```
   
   The result is show normal and BE dose not crash. If any step is wrong, please let me know.
   
   I have referenced the steps to reproduce the bug in [1]
   
   1. https://github.com/StarRocks/starrocks/issues/1172


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

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



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