Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Not A Problem
-
2.4.3
-
None
-
None
Description
description
- About org.apache.spark.sql.Row.getAs(), It doesn't return zero value in java even if I used primitive type null value. (scala return zero value.) Here is an example with spark ver 2.4.3.
@Test public void testIntegerTypeNull() { StructType schema = createStructType(Arrays.asList(createStructField("test", IntegerType, true))); Object[] values = new Object[1]; values[0] = null; Row row = new GenericRowWithSchema(values, schema); Integer result = row.getAs("test"); System.out.println(result); // result = null }
- This problem is shown by not only Integer type, but also all primitive types of java like double, long and so on. I really appreciate if you confirm whether it is a normal or not.