You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "wu-a-ge (via GitHub)" <gi...@apache.org> on 2023/08/01 15:47:10 UTC

[GitHub] [seatunnel] wu-a-ge commented on pull request #5014: [Feature][Transform-V2][SQL] Support case when clause for SQL Transform plugin (#5013)

wu-a-ge commented on PR #5014:
URL: https://github.com/apache/seatunnel/pull/5014#issuecomment-1660593730

   > Update, please check, thanks. @wu-a-ge In another way, Number.*Value() method performance should be better when run with JDK 9 or above. ![image](https://user-images.githubusercontent.com/9191388/257384174-5fa9ebeb-7f13-4d73-be6a-f75e924ec3a7.png)
   > 
   > ```java
   >                 case TINYINT:
   >                     statement.setByte(
   >                             statementIndex, ((Number) row.getField(fieldIndex)).byteValue());
   >                     break;
   >                 case SMALLINT:
   >                     statement.setShort(
   >                             statementIndex, ((Number) row.getField(fieldIndex)).shortValue());
   >                     break;
   >                 case INT:
   >                     statement.setInt(
   >                             statementIndex, ((Number) row.getField(fieldIndex)).intValue());
   >                     break;
   >                 case BIGINT:
   >                     statement.setLong(
   >                             statementIndex, ((Number) row.getField(fieldIndex)).longValue());
   >                     break;
   >                 case FLOAT:
   >                     statement.setFloat(
   >                             statementIndex, ((Number) row.getField(fieldIndex)).floatValue());
   >                     break;
   >                 case DOUBLE:
   >                     statement.setDouble(
   >                             statementIndex, ((Number) row.getField(fieldIndex)).doubleValue());
   > ```
   Found a bug, 
   ![image](https://github.com/apache/seatunnel/assets/2646059/d8fc254a-4a3f-4a21-8824-dc8094b617e8)
   caseExpression.getElseExpression() may be null,so there will throw a NullPointException
   ![image](https://github.com/apache/seatunnel/assets/2646059/23092c5f-d99d-42fc-a18c-9a4bafa5b298)
   @javalover123 
   


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

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