Package com.facebook.presto.spi

Examples of com.facebook.presto.spi.PrestoException


        String message = format("Function %s not registered", name);
        if (!expectedParameters.isEmpty()) {
            String expected = Joiner.on(", ").join(expectedParameters);
            message = format("Unexpected parameters (%s) for function %s. Expected: %s", parameters, name, expected);
        }
        throw new PrestoException(StandardErrorCode.FUNCTION_NOT_FOUND, message);
    }
View Full Code Here


                endTime = DateTime.now();
            }
        }
        synchronized (this) {
            if (failureCause == null) {
                failureCause = new PrestoException(StandardErrorCode.USER_CANCELED, "Query was canceled");
            }
        }
        return queryState.setIf(CANCELED, Predicates.not(inDoneState()));
    }
View Full Code Here

        log.debug("Dropping %s", tableName);

        final Optional<TableHandle> tableHandle = metadataManager.getTableHandle(tableName);
        checkState(tableHandle.isPresent(), "Table %s does not exist", tableName);
        if (!(tableHandle.get() instanceof NativeTableHandle)) {
            throw new PrestoException(CANNOT_DROP_TABLE, "Can only drop native tables");
        }

        Set<TablePartition> partitions = shardManager.getPartitions(tableHandle.get());
        for (TablePartition partition : partitions) {
            shardManager.dropPartition(tableHandle.get(), partition.getPartitionName());
View Full Code Here

                case INT:
                    return value.getInt() != 0;
                case LONG:
                    return value.getLong() != 0;
                default:
                    throw new PrestoException(KafkaErrorCode.KAFKA_CONVERSION_NOT_SUPPORTED.toErrorCode(), format("conversion %s to boolean not supported", fieldType));
            }
        }
View Full Code Here

                case INT:
                    return value.getInt();
                case LONG:
                    return value.getLong();
                default:
                    throw new PrestoException(KafkaErrorCode.KAFKA_CONVERSION_NOT_SUPPORTED.toErrorCode(), format("conversion %s to long not supported", fieldType));
            }
        }
View Full Code Here

                case FLOAT:
                    return value.getFloat();
                case DOUBLE:
                    return value.getDouble();
                default:
                    throw new PrestoException(KafkaErrorCode.KAFKA_CONVERSION_NOT_SUPPORTED.toErrorCode(), format("conversion %s to double not supported", fieldType));
            }
        }
View Full Code Here

            if (fieldType == FieldType.BYTE) {
                return Slices.wrappedBuffer(value.slice());
            }

            throw new PrestoException(KafkaErrorCode.KAFKA_CONVERSION_NOT_SUPPORTED.toErrorCode(), format("conversion %s to Slice not supported", fieldType));
        }
View Full Code Here

        }

        @Override
        public boolean getBoolean()
        {
            throw new PrestoException(KafkaErrorCode.KAFKA_CONVERSION_NOT_SUPPORTED.toErrorCode(), "conversion to boolean not supported");
        }
View Full Code Here

        }

        @Override
        public double getDouble()
        {
            throw new PrestoException(KafkaErrorCode.KAFKA_CONVERSION_NOT_SUPPORTED.toErrorCode(), "conversion to double not supported");
        }
View Full Code Here

            }

            @Override
            public boolean isNull()
            {
                throw new PrestoException(KafkaErrorCode.KAFKA_CONVERSION_NOT_SUPPORTED.toErrorCode(), "is null check not supported");
            }
        };
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.spi.PrestoException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.