You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "wankunde (via GitHub)" <gi...@apache.org> on 2023/08/11 09:17:18 UTC

[GitHub] [spark] wankunde commented on pull request #42376: [SPARK-44700][SQL] Rule OptimizeCsvJsonExprs should not be applied to expression like from_json(regexp_replace)

wankunde commented on PR #42376:
URL: https://github.com/apache/spark/pull/42376#issuecomment-1674441218

   I think we can reuse the result of the same regexp_replace functions, for example, we can reuse the result of `regexp_replace(s, 'a', 'x')` :
   
   ```sql
   SELECT from_json(regexp_replace(s, 'a', 'x'), 'x INT, b DOUBLE').x,
          from_json(regexp_replace(s, 'a', 'x'), 'x INT, b DOUBLE').b
   FROM values('{"a":1, "b":0.8}') t(s)
   ```
   
   Filed another PR for this purpose: https://github.com/apache/spark/pull/42450
   
   cc @cloud-fan @wangyum 


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

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


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