log.debug("Dropping %s", tableName);
final Optional<TableHandle> tableHandle = metadataManager.getTableHandle(session, tableName);
checkState(tableHandle.isPresent(), "Table %s does not exist", tableName);
final ConnectorTableHandle connectorHandle = tableHandle.get().getConnectorHandle();
if (!(connectorHandle instanceof NativeTableHandle)) {
throw new PrestoException(CANNOT_DROP_TABLE.toErrorCode(), "Can only drop native tables");
}
Set<TablePartition> partitions = shardManager.getPartitions(tableHandle.get().getConnectorHandle());