Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-9614

Improve the error message for Compiler#compile

    XMLWordPrintableJSON

Details

    Description

      When the below sql has too long. Like

      case when .... case when .....
      when host in ('114.67.56.94','114.67.56.102','114.67.56.103','114.67.56.106','114.67.56.107','183.60.220.231','183.60.220.232','183.60.219.247','114.67.56.94','114.67.56.102','114.67.56.103','114.67.56.106','114.67.56.107','183.60.220.231','183.60.220.232','183.60.219.247','114.67.56.94','114.67.56.102','114.67.56.103','114.67.56.106','114.67.56.107','183.60.220.231','183.60.220.232','183.60.219.247') then 'condition'

      Then cause the StackOverflowError. And the current code is below, we can solve this by setting -Xss 20m, instead of This is a bug......

      trait Compiler[T] {
      
        @throws(classOf[CompileException])
        def compile(cl: ClassLoader, name: String, code: String): Class[T] = {
          require(cl != null, "Classloader must not be null.")
          val compiler = new SimpleCompiler()
          compiler.setParentClassLoader(cl)
          try {
            compiler.cook(code)
          } catch {
            case t: Throwable =>
              throw new InvalidProgramException("Table program cannot be compiled. " +
                "This is a bug. Please file an issue.", t)
          }
          compiler.getClassLoader.loadClass(name).asInstanceOf[Class[T]]
        }
      }
      

      Attachments

        Activity

          People

            mingleizhang zhangminglei
            mingleizhang zhangminglei
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: