Josh Rosen created SPARK-8782:
---------------------------------

             Summary: GenerateOrdering fails for NullType (i.e. ORDER BY NULL 
crashes)
                 Key: SPARK-8782
                 URL: https://issues.apache.org/jira/browse/SPARK-8782
             Project: Spark
          Issue Type: New Feature
          Components: SQL
    Affects Versions: 1.5.0
            Reporter: Josh Rosen
            Assignee: Josh Rosen
            Priority: Blocker


Queries containing ORDER BY NULL currently result in a code generation 
exception:

{code}
      public SpecificOrdering 
generate(org.apache.spark.sql.catalyst.expressions.Expression[] expr) {
        return new SpecificOrdering(expr);
      }

      class SpecificOrdering extends 
org.apache.spark.sql.catalyst.expressions.codegen.BaseOrdering {

        private org.apache.spark.sql.catalyst.expressions.Expression[] 
expressions = null;

        public 
SpecificOrdering(org.apache.spark.sql.catalyst.expressions.Expression[] expr) {
          expressions = expr;
        }

        @Override
        public int compare(InternalRow a, InternalRow b) {
          InternalRow i = null;  // Holds current row being evaluated.
          
          i = a;
          final Object primitive1 = null;
          i = b;
          final Object primitive3 = null;
          if (true && true) {
            // Nothing
          } else if (true) {
            return -1;
          } else if (true) {
            return 1;
          } else {
            int comp = primitive1.compare(primitive3);
            if (comp != 0) {
              return comp;
            }
          }
      
          return 0;
        }
      }
org.codehaus.commons.compiler.CompileException: Line 29, Column 43: A method 
named "compare" is not declared in any enclosing class nor any supertype, nor 
through a static import
        at 
org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:10174)
{code}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to