/** * Throw a TajoRuntimeException. It is usually used for unexpected exceptions. * * @param state ReturnState * @return True if no error. */ public static boolean ensureOk(ReturnState state) { if (isError(state)) { throw new TajoRuntimeException(state); } return true; }
public static <T extends Tablespace> T getByName(String name) { URI uri = SPACES_URIS_MAP.get(name); if (uri != null) { return (T) TABLE_SPACES.get(uri); } else { throw new TajoRuntimeException(new UndefinedTablespaceException(name)); } }
/** * if {@link StorageProperty#isArbitraryPathAllowed} is true, * the storage allows arbitrary path accesses. In this case, the storage must provide the root URI. * * @see {@link StorageProperty#isArbitraryPathAllowed} * @return Root URI */ public URI getRootUri() { throw new TajoRuntimeException(new UnsupportedException(String.format("artibrary path '%s'", uri.toString()))); }
@SuppressWarnings("unused") public int markAccetablePlanPart(LogicalPlan plan) { throw new TajoRuntimeException(new UnsupportedException()); } }
@Override public List<TajoMasterInfo> getMasters() throws IOException { throw new TajoRuntimeException(new UnsupportedException()); } }
/** * Resets the scanner */ @Override public void reset() throws IOException { throw new TajoRuntimeException(new NotImplementedException()); }
@Override public Datum[] getValues() { throw new TajoRuntimeException(new UnsupportedException()); } }
@Override public URI getStagingUri(OverridableConf context, String queryId, TableMeta meta) throws IOException { throw new TajoRuntimeException(new UnsupportedException()); } }
@Override public Schema getSchema() { throw new TajoRuntimeException(new NotImplementedException()); } }
@Override public Datum[] getValues() { throw new TajoRuntimeException(new UnsupportedException()); } }
@SuppressWarnings("unused") public int markAccetablePlanPart(LogicalPlan plan) { throw new TajoRuntimeException(new UnsupportedException()); } }
@Override public TupleRange[] getInsertSortRanges(OverridableConf queryContext, TableDesc tableDesc, Schema inputSchema, SortSpec[] sortSpecs, TupleRange dataRange) throws IOException { throw new TajoRuntimeException(new NotImplementedException()); }
@Override public Path commitTable(OverridableConf queryContext, ExecutionBlockId finalEbId, LogicalPlan plan, Schema schema, TableDesc tableDesc) throws IOException { throw new TajoRuntimeException(new NotImplementedException()); }
public void seek(long offset) throws IOException { if (isCompressed()) throw new TajoRuntimeException(new UnsupportedException()); lineReader.seek(offset); pos = offset; eof = false; }
public DelimitedLineReader(Configuration conf, final FileFragment fragment, int bufferSize) throws IOException { this.fragment = fragment; this.conf = conf; this.factory = new CompressionCodecFactory(conf); this.codec = factory.getCodec(fragment.getPath()); this.bufferSize = bufferSize; if (this.codec instanceof SplittableCompressionCodec) { // bzip2 does not support multi-thread model throw new TajoRuntimeException( new NotImplementedException(this.getClass() + " does not support " + this.codec.getDefaultExtension())); } }
@Override public TablespaceProto getTablespace(String spaceName) { if (spaceName.equals(TajoConstants.DEFAULT_TABLESPACE_NAME)) { TablespaceProto.Builder builder = TablespaceProto.newBuilder(); builder.setSpaceName(TajoConstants.DEFAULT_TABLESPACE_NAME); builder.setUri(defaultTableSpaceUri); return builder.build(); } else { throw new TajoRuntimeException(new UnsupportedException("Tablespace in HiveMeta")); } }
public static Datum createFromInt4(DataType type, int val) { switch (type.getType()) { case INT4: return new Int4Datum(val); case DATE: return new DateDatum(val); default: throw new TajoRuntimeException(new UnsupportedDataTypeException(type.getType().name())); } }
public static Field convert(Column column) { if (column.type.isStruct() && column.getTypeDesc().getNestedSchema() == null) { throw new TajoRuntimeException(new NotImplementedException("record type projection")); } return new Field(toQualifiedIdentifier(column.getQualifiedName()), column.type); }
public static AggFunctionInvoke newInstance(FunctionDesc desc) { // TODO: The below line is due to the bug in the function type. The type of class-based functions is not set properly. if (desc.getInvocation().hasLegacy()) { return new ClassBasedAggFunctionInvoke(desc); } else if (desc.getInvocation().hasPythonAggregation()) { return new PythonAggFunctionInvoke(desc); } else { throw new TajoRuntimeException(new UnsupportedException(desc.getInvocation().toString())); } }
public static FunctionInvoke newInstance(FunctionDesc desc) { if (desc.getInvocation().hasLegacy()) { return new ClassBasedScalarFunctionInvoke(desc); } else if (desc.getInvocation().hasPython()) { return new PythonFunctionInvoke(desc); } else if (desc.getInvocation().hasHiveUDF()) { return new HiveFunctionInvoke(desc); } else { throw new TajoRuntimeException(new UnsupportedException("function invocation '" + desc.getInvocation() + "'")); } }