我最近将项目升级到Apache Spark 2.1.0。
代码生成功能将生成的代码内容写入标准输出。例如:
// Class file version = 49.0 (J2SE 5.0)
package org.apache.spark.sql.catalyst.expressions;
public class GeneratedClass extends codegen.GeneratedClass {
// Enclosing/enclosed types:
// GeneratedClass { final class GeneratedClass$GeneratedIterator }
public Object generate(Object[] p1) {
new GeneratedClass$GeneratedIterator
dup
aload [this]
aload [Object[] p1]
invokespecial GeneratedClass$GeneratedIterator(GeneratedClass, Object[])
areturn
}
尽管我找到了用于启用/禁用代码生成的选项
spark.sql.codegen.wholeStage
,但我没有找到用于仅关闭生成代码输出的选项。通过火花选项控制吗?记录配置?
最佳答案
import org.slf4j.LoggerFactory;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
Logger root = (Logger)LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
root.setLevel(Level.INFO);