You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "afedulov (via GitHub)" <gi...@apache.org> on 2025/01/09 16:00:30 UTC

[PR] [FLINK-35721][docs] Fix CAST compatibility table [flink]

afedulov opened a new pull request, #25938:
URL: https://github.com/apache/flink/pull/25938

   Minor documentation fix.
   Verified by:
   
   ```sql
   -- Casting DECIMAL to BOOLEAN
   SELECT CAST(CAST(0.0 AS DECIMAL) AS BOOLEAN) AS decimal_zero,
          CAST(CAST(-1.0 AS DECIMAL) AS BOOLEAN) AS decimal_negative,
          CAST(CAST(1.0 AS DECIMAL) AS BOOLEAN) AS decimal_positive;
   
   -> FALSE, TRUE, TRUE
   
   -- Casting FLOAT to BOOLEAN
   SELECT CAST(CAST(0.0 AS FLOAT) AS BOOLEAN) AS float_zero,
          CAST(CAST(-3.14 AS FLOAT) AS BOOLEAN) AS float_negative,
          CAST(CAST(3.14 AS FLOAT) AS BOOLEAN) AS float_positive;
   
   -> FALSE, TRUE, TRUE
   
   -- Casting DOUBLE to BOOLEAN
   SELECT CAST(CAST(0.0 AS DOUBLE) AS BOOLEAN) AS double_zero,
          CAST(CAST(-3.14 AS DOUBLE) AS BOOLEAN) AS double_negative,
          CAST(CAST(3.14 AS DOUBLE) AS BOOLEAN) AS double_positive;
   
   -> FALSE, TRUE, TRUE
   ```


-- 
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: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-35721][docs] Fix CAST compatibility table [flink]

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on PR #25938:
URL: https://github.com/apache/flink/pull/25938#issuecomment-2586494341

   btw the failure seems to be fixed at https://issues.apache.org/jira/browse/FLINK-37006
   
   i think rebase should help


-- 
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: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-35721][docs] Fix CAST compatibility table [flink]

Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #25938:
URL: https://github.com/apache/flink/pull/25938#issuecomment-2580663053

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8ea68668ccdac3b46b3fe695e8bbc02613bfc800",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "8ea68668ccdac3b46b3fe695e8bbc02613bfc800",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8ea68668ccdac3b46b3fe695e8bbc02613bfc800 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-35721][docs] Fix CAST compatibility table [flink]

Posted by "afedulov (via GitHub)" <gi...@apache.org>.
afedulov merged PR #25938:
URL: https://github.com/apache/flink/pull/25938


-- 
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: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-35721][docs] Fix CAST compatibility table [flink]

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on PR #25938:
URL: https://github.com/apache/flink/pull/25938#issuecomment-2585908533

   ah' true
   
   thanks for clarifying this
   
   yep, I think in case casting to BOOLEAN makes sense
   
   thanks for checking corner cases :+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: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-35721][docs] Fix CAST compatibility table [flink]

Posted by "afedulov (via GitHub)" <gi...@apache.org>.
afedulov commented on PR #25938:
URL: https://github.com/apache/flink/pull/25938#issuecomment-2586790001

   @snuyanzin thanks for the heads up.
   
   Could you please also stamp these two backports:
   https://github.com/apache/flink/pull/25940
   https://github.com/apache/flink/pull/25939
   


-- 
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: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-35721][docs] Fix CAST compatibility table [flink]

Posted by "afedulov (via GitHub)" <gi...@apache.org>.
afedulov commented on PR #25938:
URL: https://github.com/apache/flink/pull/25938#issuecomment-2585894708

   Just to clarify - this PR is solely about casting between to BOOLEAN. All of the below expressions work:
   ```sql
   -- Casting NaN as BOOLEAN
   SELECT CAST(SQRT(-1) AS BOOLEAN) as nan;
   -> TRUE
   
   -- Casting Infinity, -Inifinity as BOOLEAN
   SELECT CAST(power(0, -1)AS BOOLEAN) as infinity_to_boolean,
                  CAST(-power(0, -1)AS BOOLEAN) as neg_infinity_to_boolean;
   -> TRUE, TRUE
   ```


-- 
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: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-35721][docs] Fix CAST compatibility table [flink]

Posted by "afedulov (via GitHub)" <gi...@apache.org>.
afedulov commented on PR #25938:
URL: https://github.com/apache/flink/pull/25938#issuecomment-2582971634

   @flinkbot run azure


-- 
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: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-35721][docs] Fix CAST compatibility table [flink]

Posted by "afedulov (via GitHub)" <gi...@apache.org>.
afedulov commented on PR #25938:
URL: https://github.com/apache/flink/pull/25938#issuecomment-2583819948

   Test failures are unrelated to the change.
   


-- 
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: issues-unsubscribe@flink.apache.org

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


Re: [PR] [FLINK-35721][docs] Fix CAST compatibility table [flink]

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on PR #25938:
URL: https://github.com/apache/flink/pull/25938#issuecomment-2585208995

   In general agree it is supported for most of the cases
   
   however there are some corner cases where it is not supported for instance in both FLOAT and DOUBLE there are `NaN`, `Infinity`, `-Infinity`.
   Not sure whether it is possible to make a query with `NaN` however it is possible to have something returning either `-Infinity` or `Infinity`
   for instance
   ```sql
   SELECT power(0, -1);
   ```
   or
   ```sql
   SELECT -power(0, -1);
   ```
   
   as a result casting of these doubles will NOT work since there are now infinities in DECIMAL
   so it will just fail
   ```sql
   SELECT CAST(power(0, -1) AS DECIMAL);
   ```
   
   as an option we could mark it as supported \+ add some reference note about corner cases
   
   WDYT?


-- 
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: issues-unsubscribe@flink.apache.org

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