@Override public boolean isSame(OperatorDesc other) { if (getClass().getName().equals(other.getClass().getName())) { ScriptDesc otherDesc = (ScriptDesc) other; return Objects.equals(getScriptCmd(), otherDesc.getScriptCmd()) && Objects.equals(getScriptOutputInfo(), otherDesc.getScriptOutputInfo()); } return false; }
@Override public boolean equals(ScriptOperator op1, ScriptOperator op2) { Preconditions.checkNotNull(op1); Preconditions.checkNotNull(op2); ScriptDesc desc1 = op1.getConf(); ScriptDesc desc2 = op2.getConf(); if (compareString(desc1.getScriptCmd(), desc2.getScriptCmd()) && compareObject(desc1.getScriptOutputInfo(), desc2.getScriptOutputInfo())) { return true; } else { return false; } } }
@Override protected void initializeOp(Configuration hconf) throws HiveException { super.initializeOp(hconf); firstRow = true; statsMap.put(Counter.DESERIALIZE_ERRORS.toString(), deserialize_error_count); statsMap.put(Counter.SERIALIZE_ERRORS.toString(), serialize_error_count); try { this.hconf = hconf; scriptOutputDeserializer = conf.getScriptOutputInfo() .getDeserializerClass().newInstance(); SerDeUtils.initializeSerDe(scriptOutputDeserializer, hconf, conf.getScriptOutputInfo().getProperties(), null); scriptInputSerializer = (Serializer) conf.getScriptInputInfo() .getDeserializerClass().newInstance(); scriptInputSerializer.initialize(hconf, conf.getScriptInputInfo() .getProperties()); outputObjInspector = scriptOutputDeserializer.getObjectInspector(); } catch (Exception e) { throw new HiveException(ErrorMsg.SCRIPT_INIT_ERROR.getErrorCodedMsg(), e); } }
@Override protected void initializeOp(Configuration hconf) throws HiveException { super.initializeOp(hconf); firstRow = true; statsMap.put(Counter.DESERIALIZE_ERRORS.toString(), deserialize_error_count); statsMap.put(Counter.SERIALIZE_ERRORS.toString(), serialize_error_count); try { this.hconf = hconf; scriptOutputDeserializer = conf.getScriptOutputInfo() .getDeserializerClass().newInstance(); SerDeUtils.initializeSerDe(scriptOutputDeserializer, hconf, conf.getScriptOutputInfo().getProperties(), null); scriptInputSerializer = (Serializer) conf.getScriptInputInfo() .getDeserializerClass().newInstance(); scriptInputSerializer.initialize(hconf, conf.getScriptInputInfo() .getProperties()); outputObjInspector = scriptOutputDeserializer.getObjectInspector(); } catch (Exception e) { throw new HiveException(ErrorMsg.SCRIPT_INIT_ERROR.getErrorCodedMsg(), e); } }
.newInstance(); scriptOutputReader.initialize(scriptIn, hconf, conf .getScriptOutputInfo().getProperties());
.newInstance(); scriptOutputReader.initialize(scriptIn, hconf, conf .getScriptOutputInfo().getProperties());
@Override protected void initializeOp(Configuration hconf) throws HiveException { firstRow = true; statsMap.put(Counter.DESERIALIZE_ERRORS, deserialize_error_count); statsMap.put(Counter.SERIALIZE_ERRORS, serialize_error_count); try { this.hconf = hconf; scriptOutputDeserializer = conf.getScriptOutputInfo() .getDeserializerClass().newInstance(); scriptOutputDeserializer.initialize(hconf, conf.getScriptOutputInfo() .getProperties()); scriptInputSerializer = (Serializer) conf.getScriptInputInfo() .getDeserializerClass().newInstance(); scriptInputSerializer.initialize(hconf, conf.getScriptInputInfo() .getProperties()); outputObjInspector = scriptOutputDeserializer.getObjectInspector(); // initialize all children before starting the script initializeChildren(hconf); } catch (Exception e) { throw new HiveException("Cannot initialize ScriptOperator", e); } }
@Override protected Collection<Future<?>> initializeOp(Configuration hconf) throws HiveException { Collection<Future<?>> result = super.initializeOp(hconf); firstRow = true; statsMap.put(Counter.DESERIALIZE_ERRORS.toString(), deserialize_error_count); statsMap.put(Counter.SERIALIZE_ERRORS.toString(), serialize_error_count); try { this.hconf = hconf; scriptOutputDeserializer = conf.getScriptOutputInfo() .getDeserializerClass().newInstance(); SerDeUtils.initializeSerDe(scriptOutputDeserializer, hconf, conf.getScriptOutputInfo().getProperties(), null); scriptInputSerializer = (Serializer) conf.getScriptInputInfo() .getDeserializerClass().newInstance(); scriptInputSerializer.initialize(hconf, conf.getScriptInputInfo() .getProperties()); outputObjInspector = scriptOutputDeserializer.getObjectInspector(); } catch (Exception e) { throw new HiveException(ErrorMsg.SCRIPT_INIT_ERROR.getErrorCodedMsg(), e); } return result; }
.newInstance(); scriptOutputReader.initialize(scriptIn, hconf, conf .getScriptOutputInfo().getProperties());
.newInstance(); scriptOutputReader.initialize(scriptIn, hconf, conf .getScriptOutputInfo().getProperties());