abhiips07 commented on PR #47246:
URL: https://github.com/apache/spark/pull/47246#issuecomment-2224482259

   > When can this happen?
   
   Additionally, I achieve correct results with other RDBMS such as MySQL and 
Redshift/PostgreSQL.
   
   **MYSQL**
   
   ```
   CREATE TEMPORARY TABLE person (
       id VARCHAR(100),
       NAME VARCHAR(100)
   );
   ```
   
   
   ```
   INSERT INTO person VALUES("a","amit");
   INSERT INTO person VALUES("b","abhishek");
   ```
   
   
   **SELECT * FROM person WHERE id<>-1;**
   
   ```
   "id" "NAME"
   "a"  "amit"
   "b"  "abhishek"
   ```
   
   
   ```
   EXPLAIN FORMAT=JSON
   SELECT * FROM person WHERE id<>-1;
   ```
   
   
   
   **I get the following Explain Plan in MySQL** 
   
   `{
     "query_block": {
       "select_id": 1,
       "cost_info": {
         "query_cost": "0.45"
       },
       "table": {
         "table_name": "person",
         "access_type": "ALL",
         "rows_examined_per_scan": 2,
         "rows_produced_per_join": 1,
         "filtered": "50.00",
         "cost_info": {
           "read_cost": "0.35",
           "eval_cost": "0.10",
           "prefix_cost": "0.45",
           "data_read_per_join": "608"
         },
         "used_columns": [
           "id",
           "NAME"
         ],
         "attached_condition": "(`temp_db`.`person`.`id` <> <cache>(-(1)))"
       }
     }
   }`
   


-- 
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: reviews-unsubscr...@spark.apache.org

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


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

Reply via email to