You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "andygrove (via GitHub)" <gi...@apache.org> on 2024/05/23 19:03:30 UTC

[I] bug: substring with negative indices produces incorrect results [datafusion-comet]

andygrove opened a new issue, #463:
URL: https://github.com/apache/datafusion-comet/issues/463

   ### Describe the bug
   
   repro is to modify this existing test in `CometExpressionSuite` to also test negative indices:
   
   ```scala
     test("string type and substring") {
       withParquetTable((0 until 5).map(i => (i.toString, (i + 100).toString)), "tbl") {
         checkSparkAnswerAndOperator("SELECT _1, substring(_2, 2, 2) FROM tbl")
         checkSparkAnswerAndOperator("SELECT _1, substring(_2, 2, -2) FROM tbl")
         checkSparkAnswerAndOperator("SELECT _1, substring(_2, -2, 2) FROM tbl")
         checkSparkAnswerAndOperator("SELECT _1, substring(_2, -2, -2) FROM tbl")
       }
     }
   ```
   
   output:
   
   ```
   == Results ==
   !== Correct Answer - 5 ==                        == Spark Answer - 5 ==
    struct<_1:string,substring(_2, 2, -2):string>   struct<_1:string,substring(_2, 2, -2):string>
   ![0,]                                            [0,00]
   ![1,]                                            [1,01]
   ![2,]                                            [2,02]
   ![3,]                                            [3,03]
   ![4,]                                            [4,04]
   ```
   
   ### Steps to reproduce
   
   _No response_
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
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: github-unsubscribe@datafusion.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] bug: substring with negative indices produces incorrect results [datafusion-comet]

Posted by "sonhmai (via GitHub)" <gi...@apache.org>.
sonhmai commented on issue #463:
URL: https://github.com/apache/datafusion-comet/issues/463#issuecomment-2130650900

   i'm working on this.


-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] bug: substring with negative indices produces incorrect results [datafusion-comet]

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya closed issue #463: bug: substring with negative indices produces incorrect results
URL: https://github.com/apache/datafusion-comet/issues/463


-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org