[jira] [Commented] (FLINK-17334) Flink does not support HIVE UDFs with primitive return types

2020-04-28 Thread xin.ruan (Jira)


[ 
https://issues.apache.org/jira/browse/FLINK-17334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17095031#comment-17095031
 ] 

xin.ruan commented on FLINK-17334:
--

ok

>  Flink does not support HIVE UDFs with primitive return types
> -
>
> Key: FLINK-17334
> URL: https://issues.apache.org/jira/browse/FLINK-17334
> Project: Flink
>  Issue Type: Bug
>  Components: Connectors / Hive
>Affects Versions: 1.10.0
>Reporter: xin.ruan
>Assignee: xin.ruan
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.10.1
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> We are currently migrating Hive UDF to Flink. While testing compatibility, we 
> found that Flink cannot support primitive types like boolean, int, etc.
> Hive UDF:
> public class UDFTest extends UDF {
>  public boolean evaluate(String content) {
>  if (StringUtils.isEmpty(content))
> { return false; }
> else
> { return true; }
> }
> }
> We found that the following error will be reported:
>  Caused by: org.apache.flink.table.functions.hive.FlinkHiveUDFException: 
> Class boolean is not supported yet
>  at 
> org.apache.flink.table.functions.hive.conversion.HiveInspectors.getObjectInspector(HiveInspectors.java:372)
>  at 
> org.apache.flink.table.functions.hive.HiveSimpleUDF.getHiveResultType(HiveSimpleUDF.java:133)
> I found that if I add the type comparison in 
> HiveInspectors.getObjectInspector to the primitive type, I can get the 
> correct result.
> as follows:
>  public static ObjectInspector getObjectInspector(HiveShim hiveShim, Class 
> clazz){       
>    ..
>           else if (clazz.equals(boolean.class) || clazz.equals(Boolean.class) 
> ||                  clazz.equals(BooleanWritable.class))
> {                                       typeInfo = 
> TypeInfoFactory.booleanTypeInfo;                                 }
>          ..
> }
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FLINK-17334) Flink does not support HIVE UDFs with primitive return types

2020-04-28 Thread Jingsong Lee (Jira)


[ 
https://issues.apache.org/jira/browse/FLINK-17334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17095024#comment-17095024
 ] 

Jingsong Lee commented on FLINK-17334:
--

[~royruan] before closing, we should wait for 
[https://github.com/apache/flink/pull/11939]

>  Flink does not support HIVE UDFs with primitive return types
> -
>
> Key: FLINK-17334
> URL: https://issues.apache.org/jira/browse/FLINK-17334
> Project: Flink
>  Issue Type: Bug
>  Components: Connectors / Hive
>Affects Versions: 1.10.0
>Reporter: xin.ruan
>Assignee: xin.ruan
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.10.1
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> We are currently migrating Hive UDF to Flink. While testing compatibility, we 
> found that Flink cannot support primitive types like boolean, int, etc.
> Hive UDF:
> public class UDFTest extends UDF {
>  public boolean evaluate(String content) {
>  if (StringUtils.isEmpty(content))
> { return false; }
> else
> { return true; }
> }
> }
> We found that the following error will be reported:
>  Caused by: org.apache.flink.table.functions.hive.FlinkHiveUDFException: 
> Class boolean is not supported yet
>  at 
> org.apache.flink.table.functions.hive.conversion.HiveInspectors.getObjectInspector(HiveInspectors.java:372)
>  at 
> org.apache.flink.table.functions.hive.HiveSimpleUDF.getHiveResultType(HiveSimpleUDF.java:133)
> I found that if I add the type comparison in 
> HiveInspectors.getObjectInspector to the primitive type, I can get the 
> correct result.
> as follows:
>  public static ObjectInspector getObjectInspector(HiveShim hiveShim, Class 
> clazz){       
>    ..
>           else if (clazz.equals(boolean.class) || clazz.equals(Boolean.class) 
> ||                  clazz.equals(BooleanWritable.class))
> {                                       typeInfo = 
> TypeInfoFactory.booleanTypeInfo;                                 }
>          ..
> }
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FLINK-17334) Flink does not support HIVE UDFs with primitive return types

2020-04-28 Thread Jingsong Lee (Jira)


[ 
https://issues.apache.org/jira/browse/FLINK-17334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17095015#comment-17095015
 ] 

Jingsong Lee commented on FLINK-17334:
--

master: e8503986132f0ffaeec91caf5da6ece2d0eb70d3

>  Flink does not support HIVE UDFs with primitive return types
> -
>
> Key: FLINK-17334
> URL: https://issues.apache.org/jira/browse/FLINK-17334
> Project: Flink
>  Issue Type: Bug
>  Components: Connectors / Hive
>Affects Versions: 1.10.0
>Reporter: xin.ruan
>Assignee: xin.ruan
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.10.1
>
> Attachments: screenshot-1.png
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> We are currently migrating Hive UDF to Flink. While testing compatibility, we 
> found that Flink cannot support primitive types like boolean, int, etc.
> Hive UDF:
> public class UDFTest extends UDF {
>  public boolean evaluate(String content) {
>  if (StringUtils.isEmpty(content))
> { return false; }
> else
> { return true; }
> }
> }
> We found that the following error will be reported:
>  Caused by: org.apache.flink.table.functions.hive.FlinkHiveUDFException: 
> Class boolean is not supported yet
>  at 
> org.apache.flink.table.functions.hive.conversion.HiveInspectors.getObjectInspector(HiveInspectors.java:372)
>  at 
> org.apache.flink.table.functions.hive.HiveSimpleUDF.getHiveResultType(HiveSimpleUDF.java:133)
> I found that if I add the type comparison in 
> HiveInspectors.getObjectInspector to the primitive type, I can get the 
> correct result.
> as follows:
>  public static ObjectInspector getObjectInspector(HiveShim hiveShim, Class 
> clazz){       
>    ..
>           else if (clazz.equals(boolean.class) || clazz.equals(Boolean.class) 
> ||                  clazz.equals(BooleanWritable.class)){                     
>                   
>   typeInfo = TypeInfoFactory.booleanTypeInfo;                 
>                 
>   }
>          ..
> }
>  !screenshot-1.png! 
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FLINK-17334) Flink does not support HIVE UDFs with primitive return types

2020-04-23 Thread xin.ruan (Jira)


[ 
https://issues.apache.org/jira/browse/FLINK-17334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17091141#comment-17091141
 ] 

xin.ruan commented on FLINK-17334:
--

Hi all, I want to support array and map types, but I found that I can't get the 
type of key and value in Map type, and can't create the corresponding object 
inspector, I have added the picture to my question。

If I want to create Map's object inspector, I need to call

ObjectInspectorFactory.getStandardMapObjectInspector(getObjectInspector(mapType.getMapKeyTypeInfo()),
 getObjectInspector(mapType.getMapValueTypeInfo()));

And I need to get MapValueTypeInfo() and MapKeyTypeInfo()

>  Flink does not support HIVE UDFs with primitive return types
> -
>
> Key: FLINK-17334
> URL: https://issues.apache.org/jira/browse/FLINK-17334
> Project: Flink
>  Issue Type: Bug
>  Components: Connectors / Hive
>Affects Versions: 1.10.0
>Reporter: xin.ruan
>Assignee: xin.ruan
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.10.1
>
> Attachments: screenshot-1.png
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> We are currently migrating Hive UDF to Flink. While testing compatibility, we 
> found that Flink cannot support primitive types like boolean, int, etc.
> Hive UDF:
> public class UDFTest extends UDF {
>  public boolean evaluate(String content) {
>  if (StringUtils.isEmpty(content))
> { return false; }
> else
> { return true; }
> }
> }
> We found that the following error will be reported:
>  Caused by: org.apache.flink.table.functions.hive.FlinkHiveUDFException: 
> Class boolean is not supported yet
>  at 
> org.apache.flink.table.functions.hive.conversion.HiveInspectors.getObjectInspector(HiveInspectors.java:372)
>  at 
> org.apache.flink.table.functions.hive.HiveSimpleUDF.getHiveResultType(HiveSimpleUDF.java:133)
> I found that if I add the type comparison in 
> HiveInspectors.getObjectInspector to the primitive type, I can get the 
> correct result.
> as follows:
>  public static ObjectInspector getObjectInspector(HiveShim hiveShim, Class 
> clazz){       
>    ..
>           else if (clazz.equals(boolean.class) || clazz.equals(Boolean.class) 
> ||                  clazz.equals(BooleanWritable.class)){                     
>                   
>   typeInfo = TypeInfoFactory.booleanTypeInfo;                 
>                 
>   }
>          ..
> }
>  !screenshot-1.png! 
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FLINK-17334) Flink does not support HIVE UDFs with primitive return types

2020-04-23 Thread Jingsong Lee (Jira)


[ 
https://issues.apache.org/jira/browse/FLINK-17334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090390#comment-17090390
 ] 

Jingsong Lee commented on FLINK-17334:
--

Hi [~royruan] assigned to you, before creating pull request, it is better to 
request assigning.

>  Flink does not support HIVE UDFs with primitive return types
> -
>
> Key: FLINK-17334
> URL: https://issues.apache.org/jira/browse/FLINK-17334
> Project: Flink
>  Issue Type: Bug
>  Components: Connectors / Hive
>Affects Versions: 1.10.0
>Reporter: xin.ruan
>Assignee: xin.ruan
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.10.1
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> We are currently migrating Hive UDF to Flink. While testing compatibility, we 
> found that Flink cannot support primitive types like boolean, int, etc.
> Hive UDF:
> public class UDFTest extends UDF {
>  public boolean evaluate(String content) {
>  if (StringUtils.isEmpty(content))
> { return false; }
> else
> { return true; }
> }
> }
> We found that the following error will be reported:
>  Caused by: org.apache.flink.table.functions.hive.FlinkHiveUDFException: 
> Class boolean is not supported yet
>  at 
> org.apache.flink.table.functions.hive.conversion.HiveInspectors.getObjectInspector(HiveInspectors.java:372)
>  at 
> org.apache.flink.table.functions.hive.HiveSimpleUDF.getHiveResultType(HiveSimpleUDF.java:133)
> I found that if I add the type comparison in 
> HiveInspectors.getObjectInspector to the primitive type, I can get the 
> correct result.
> as follows:
>  public static ObjectInspector getObjectInspector(HiveShim hiveShim, Class 
> clazz){       
>    ..
>           else if (clazz.equals(boolean.class) || clazz.equals(Boolean.class) 
> ||                  clazz.equals(BooleanWritable.class)){                     
>                   
>   typeInfo = TypeInfoFactory.booleanTypeInfo;                 
>                 
>   }
>          ..
> }
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FLINK-17334) Flink does not support HIVE UDFs with primitive return types

2020-04-22 Thread Jingsong Lee (Jira)


[ 
https://issues.apache.org/jira/browse/FLINK-17334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090312#comment-17090312
 ] 

Jingsong Lee commented on FLINK-17334:
--

Thanks [~royruan] for updating.

CC: [~lirui]

>  Flink does not support HIVE UDFs with primitive return types
> -
>
> Key: FLINK-17334
> URL: https://issues.apache.org/jira/browse/FLINK-17334
> Project: Flink
>  Issue Type: Bug
>  Components: Connectors / Hive
>Affects Versions: 1.10.0
>Reporter: xin.ruan
>Priority: Major
> Fix For: 1.10.1
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> We are currently migrating Hive UDF to Flink. While testing compatibility, we 
> found that Flink cannot support primitive types like boolean, int, etc.
> Hive UDF:
> public class UDFTest extends UDF {
>  public boolean evaluate(String content) {
>  if (StringUtils.isEmpty(content))
> { return false; }
> else
> { return true; }
> }
> }
> We found that the following error will be reported:
>  Caused by: org.apache.flink.table.functions.hive.FlinkHiveUDFException: 
> Class boolean is not supported yet
>  at 
> org.apache.flink.table.functions.hive.conversion.HiveInspectors.getObjectInspector(HiveInspectors.java:372)
>  at 
> org.apache.flink.table.functions.hive.HiveSimpleUDF.getHiveResultType(HiveSimpleUDF.java:133)
> I found that if I add the type comparison in 
> HiveInspectors.getObjectInspector to the primitive type, I can get the 
> correct result.
> as follows:
>  public static ObjectInspector getObjectInspector(HiveShim hiveShim, Class 
> clazz){       
>    ..
>           else if (clazz.equals(boolean.class) || clazz.equals(Boolean.class) 
> ||                  clazz.equals(BooleanWritable.class)){                     
>                   
>   typeInfo = TypeInfoFactory.booleanTypeInfo;                 
>                 
>   }
>          ..
> }
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FLINK-17334) Flink does not support HIVE UDFs with primitive return types

2020-04-22 Thread xin.ruan (Jira)


[ 
https://issues.apache.org/jira/browse/FLINK-17334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090313#comment-17090313
 ] 

xin.ruan commented on FLINK-17334:
--

Thanks for the reply, I added my question

>  Flink does not support HIVE UDFs with primitive return types
> -
>
> Key: FLINK-17334
> URL: https://issues.apache.org/jira/browse/FLINK-17334
> Project: Flink
>  Issue Type: Bug
>  Components: Connectors / Hive
>Affects Versions: 1.10.0
>Reporter: xin.ruan
>Priority: Major
> Fix For: 1.10.1
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> We are currently migrating Hive UDF to Flink. While testing compatibility, we 
> found that Flink cannot support primitive types like boolean, int, etc.
> Hive UDF:
> public class UDFTest extends UDF {
>  public boolean evaluate(String content) {
>  if (StringUtils.isEmpty(content))
> { return false; }
> else
> { return true; }
> }
> }
> We found that the following error will be reported:
>  Caused by: org.apache.flink.table.functions.hive.FlinkHiveUDFException: 
> Class boolean is not supported yet
>  at 
> org.apache.flink.table.functions.hive.conversion.HiveInspectors.getObjectInspector(HiveInspectors.java:372)
>  at 
> org.apache.flink.table.functions.hive.HiveSimpleUDF.getHiveResultType(HiveSimpleUDF.java:133)
> I found that if I add the type comparison in 
> HiveInspectors.getObjectInspector to the primitive type, I can get the 
> correct result.
> as follows:
>  public static ObjectInspector getObjectInspector(HiveShim hiveShim, Class 
> clazz){       
>    ..
>           else if (clazz.equals(boolean.class) || clazz.equals(Boolean.class) 
> ||                  clazz.equals(BooleanWritable.class)){                     
>                   
>   typeInfo = TypeInfoFactory.booleanTypeInfo;                 
>                 
>   }
>          ..
> }
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FLINK-17334) Flink does not support HIVE UDFs with primitive return types

2020-04-22 Thread Jingsong Lee (Jira)


[ 
https://issues.apache.org/jira/browse/FLINK-17334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090249#comment-17090249
 ] 

Jingsong Lee commented on FLINK-17334:
--

Hi [~royruan] thanks for reporting. Can you provide more information? Like what 
hive UDF? Maybe you can show the code.

>  Flink does not support HIVE UDFs with primitive return types
> -
>
> Key: FLINK-17334
> URL: https://issues.apache.org/jira/browse/FLINK-17334
> Project: Flink
>  Issue Type: Bug
>  Components: Connectors / Hive
>Affects Versions: 1.10.0
>Reporter: xin.ruan
>Priority: Major
> Fix For: 1.10.1
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> We are currently migrating Hive UDF to Flink. While testing compatibility, we 
> found that Flink cannot support primitive types like boolean, int, etc.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)