/** * Creates a new user exception builder . * * @see com.dremio.exec.proto.UserBitShared.DremioPBError.ErrorType#UNSUPPORTED_OPERATION * @return user exception builder */ public static Builder unsupportedError() { return unsupportedError(null); }
@POST @Produces(APPLICATION_JSON) @Path("/rename_folder/{path: .*}") public Folder renameFolder(@PathParam("path") String path, @QueryParam("renameTo") String renameTo) throws NamespaceException, FolderNotFoundException { throw UserException.unsupportedError() .message("Renaming a folder is not supported") .build(logger); }
@POST @Path("/rename") @Produces(MediaType.APPLICATION_JSON) public Space renameSpace(@QueryParam("renameTo") String renameTo) throws NamespaceException, SpaceNotFoundException { throw UserException.unsupportedError() .message("Renaming a space is not supported") .build(logger); }
public AggregateRelBase(RelOptCluster cluster, RelTraitSet traits, RelNode child, boolean indicator, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) { super(cluster, traits, child, indicator, groupSet, groupSets, aggCalls); aggCalls.forEach(a -> { if (a.filterArg >= 0) { throw UserException.unsupportedError().message("Inline aggregate filtering is not currently supported").build(logger); } }); }
public static void throwUnsupportedHiveDataTypeError(String unsupportedType) { throw UserException.unsupportedError() .message(ERROR_MSG, unsupportedType) .build(logger); }
@Override public RecordWriter getRecordWriter(OperatorContext context, EasyWriter writer) throws IOException { throw UserException .unsupportedError() .message("Writing output in Excel format is not supported") .build(logger); }
@Override public RecordWriter getRecordWriter(OperatorContext context, EasyWriter writer) throws IOException { throw UserException .unsupportedError() .message("Writing output in Avro format is not supported") .build(logger); }
@Override public int getWriterOperatorType() { throw UserException .unsupportedError() .message("Writing output in Excel format is not supported") .build(logger); } }
@Override public RelNode deserialize(String data) { throw UserException.unsupportedError().message("Kryo serializer doesn't support deserialization from JSON.").build(logger); }
private static UserException unsup(String msg){ throw UserException.unsupportedError().message("Aggregate not supported. %s", msg).build(logger); } }
private static UserException unsup(String msg) { throw UserException.unsupportedError().message("Aggregate not supported. %s", msg).build(logger); } }
public static Comparator checkAndReturnSupportedJoinComparator(JoinCondition condition) { switch(condition.getRelationship().toUpperCase()) { case "EQUALS": case "==": /* older json plans still have '==' */ return Comparator.EQUALS; case "IS_NOT_DISTINCT_FROM": return Comparator.IS_NOT_DISTINCT_FROM; } throw UserException.unsupportedError() .message("Invalid comparator supplied to this join: ", condition.getRelationship()) .build(logger); }
@Override public PartitionExplorer getPartitionExplorer() { throw UserException.unsupportedError().message("The partition explorer interface can only be used " + "in functions that can be evaluated at planning time. Make sure that the %s configuration " + "option is set to true.", PlannerSettings.CONSTANT_FOLDING.getOptionName()).build(logger); }
public <T> T getInstance(String path, Class<T> iface, Class<? extends T> defaultImpl) { if (this.hasPath(path)) { return getInstance(path, iface); } try { return instantiate(iface, defaultImpl); } catch (Exception e) { throw UserException.unsupportedError(e) .message("Failure while attempting to instantiate default implementation class %s for interface %s. The sabot config key is %s ", defaultImpl.getName(), iface.getName(), path).build(logger); } }
public static void checkDecimalTypeEnabled(OptionManager options) { if (options.getOption(PlannerSettings.ENABLE_DECIMAL_DATA_TYPE_KEY).getBoolVal() == false) { throw UserException.unsupportedError() .message(ExecErrorConstants.DECIMAL_DISABLE_ERR_MSG) .build(logger); } }
public void addCount(MutableDateTime dateTime, long count) { if (count > Integer.MAX_VALUE || count < Integer.MIN_VALUE) { throw UserException.unsupportedError() .message("Do not support adding " + count + " " + this.getNames() + " to dateTime. [" + count + "] too large/small for integer.") .build(logger); } addCount(dateTime, (int) count); }
@Override public String describe() { String suffix = (rule.getIgnoreCase() != null && rule.getIgnoreCase()) ? " ignore case" : ""; if (rule.getMatchType() == exact) { return String.format("Exactly matches \"%s\"", rule.getPattern()) + suffix; } else if (rule.getMatchType() == regex) { return String.format("Matches regex \"%s\"", rule.getPattern()) + suffix; } throw UserException.unsupportedError() .message("unsupported selection type: " + rule.getMatchType().toString()) .build(logger); }
public TransformRuleWrapper<ExtractRule> wrapRule(ExtractRule extractRule) { switch (extractRule.getType()) { case pattern: return new ExtractPatternTransformRuleWrapper(extractRule); case position: return new ExtractPositionTransformRuleWrapper(extractRule); default: throw UserException.unsupportedError() .message("Unexpected extract rule type: %s", extractRule.getType()) .build(logger); } }
@Test public void testRemoteRuntimeException() throws Exception { UserRemoteException ure = UserRemoteException.create(UserException .unsupportedError(new UserRpcException(null, "user rpc exception", new RuntimeException("test message"))) .build(logger).getOrCreatePBError(false)); exception.expect(RuntimeException.class); exception.expectMessage("test message"); RpcException.propagateIfPossible(new RpcException(ure), TestException.class); } }
@Test public void testRemoteTestException() throws Exception { UserRemoteException ure = UserRemoteException.create(UserException .unsupportedError(new UserRpcException(null, "user rpc exception", new TestException("test message"))) .build(logger).getOrCreatePBError(false)); exception.expect(TestException.class); exception.expectMessage("test message"); RpcException.propagateIfPossible(new RpcException(ure), TestException.class); }