[jira] [Updated] (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:all-tabpanel
 ]

xin.ruan updated FLINK-17334:
-
Description: 
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;                                 }

         ..

}

 

 

  was:
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! 


 


>  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] [Updated] (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:all-tabpanel
 ]

xin.ruan updated FLINK-17334:
-
Attachment: (was: screenshot-1.png)

>  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] [Updated] (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:all-tabpanel
 ]

xin.ruan updated FLINK-17334:
-
Attachment: screenshot-1.png

>  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;                 
>                 
>   }
>          ..
> }
>  



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


[jira] [Updated] (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:all-tabpanel
 ]

xin.ruan updated FLINK-17334:
-
Description: 
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! 


 

  was:
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;                   
              
  }

         ..

}




 


>  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] [Updated] (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:all-tabpanel
 ]

xin.ruan updated FLINK-17334:
-
Description: 
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;                   
              
  }

         ..

}




 

  was:
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;                   
              
  }

         ..

}

 

 


>  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] [Updated] (FLINK-17334) Flink does not support HIVE UDFs with primitive return types

2020-04-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-17334?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated FLINK-17334:
---
Labels: pull-request-available  (was: )

>  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
>  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] [Updated] (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:all-tabpanel
 ]

xin.ruan updated FLINK-17334:
-
Description: 
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;                   
              
  }

         ..

}

 

 

  was:
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;                                 }

         ..

}

 

 


>  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] [Updated] (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:all-tabpanel
 ]

xin.ruan updated FLINK-17334:
-
Description: 
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; }

}

}
{quote}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)
{quote}
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;                                 }

         ..

}

 

 

  was:
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;                    

 

          }

         ..

}

 

 


>  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; }
> }
> }
> {quote}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)
> {quote}
> 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] [Updated] (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:all-tabpanel
 ]

xin.ruan updated FLINK-17334:
-
Description: 
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;                                 }

         ..

}

 

 

  was:
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; }

}

}
{quote}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)
{quote}
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;                                 }

         ..

}

 

 


>  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] [Updated] (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:all-tabpanel
 ]

xin.ruan updated FLINK-17334:
-
Description: 
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;                    

 

          }

         ..

}

 

 

  was:
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;          

          }

         ..

}

 

 


>  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] [Updated] (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:all-tabpanel
 ]

xin.ruan updated FLINK-17334:
-
Description: 
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;          

          }

         ..

}

 

 

  was:
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;

         }

         ..

}

 

 


>  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] [Updated] (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:all-tabpanel
 ]

xin.ruan updated FLINK-17334:
-
Description: 
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;

         }

         ..

}

 

 

  was:
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;
 ..
}



>  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] [Updated] (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:all-tabpanel
 ]

xin.ruan updated FLINK-17334:
-
Description: 
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;
 ..
}


  was:We are currently migrating Hive UDF to Flink. While testing 
compatibility, we found that Flink cannot support primitive types like boolean, 
int, etc.


>  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] [Updated] (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:all-tabpanel
 ]

xin.ruan updated FLINK-17334:
-
Summary:  Flink does not support HIVE UDFs with primitive return types  
(was:  Flink does not support UDFs with primitive return types)

>  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)