@Override public List<Partition> getPartitionsByNames(String dbName, String tableName, List<String> names) throws TException { accessCount.incrementAndGet(); if (throwException) { throw new RuntimeException(); } if (!dbName.equals(TEST_DATABASE) || !tableName.equals(TEST_TABLE) || !ImmutableSet.of(TEST_PARTITION1, TEST_PARTITION2).containsAll(names)) { throw new NoSuchObjectException(); } return Lists.transform(names, name -> { try { return new Partition(ImmutableList.copyOf(Warehouse.getPartValuesFromPartName(name)), TEST_DATABASE, TEST_TABLE, 0, 0, DEFAULT_STORAGE_DESCRIPTOR, ImmutableMap.of()); } catch (MetaException e) { throw new RuntimeException(e); } }); }
@Override public void commitTransaction(Set<String> partitions, String key, String value) throws StreamingException { checkState(); Set<String> createdPartitions = new HashSet<>(); if (partitions != null) { for (String partition: partitions) { try { PartitionInfo info = createPartitionIfNotExists( Warehouse.getPartValuesFromPartName(partition)); if (!info.isExists()) { createdPartitions.add(partition); } } catch (MetaException e) { throw new StreamingException("Partition " + partition + " is invalid.", e); } } connectionStats.incrementTotalPartitions(partitions.size()); } currentTransactionBatch.commit(createdPartitions, key, value); this.partitions.addAll( currentTransactionBatch.getPartitions()); connectionStats.incrementCreatedPartitions(createdPartitions.size()); connectionStats.incrementCommittedTransactions(); }
Warehouse.getPartValuesFromPartName(cs.getStatsDesc().getPartName())); if (mpart == null || !isCurrentStatsValidForTheQuery(mpart, writeIdList, false)) {
partitionValue = Warehouse.getPartValuesFromPartName(writeEventInfo.getPartition()); ptnObj = getPartitionObj(writeEventInfo.getDatabase(), writeEventInfo.getTable(), partitionValue, tbl); root = ptnObj.getSd().getLocation();
@Override public List<Partition> getPartitionsByNames(String dbName, String tableName, List<String> names) throws TException { accessCount.incrementAndGet(); if (throwException) { throw new RuntimeException(); } if (!dbName.equals(TEST_DATABASE) || !tableName.equals(TEST_TABLE) || !ImmutableSet.of(TEST_PARTITION1, TEST_PARTITION2).containsAll(names)) { throw new NoSuchObjectException(); } return Lists.transform(names, name -> { try { return new Partition(ImmutableList.copyOf(Warehouse.getPartValuesFromPartName(name)), TEST_DATABASE, TEST_TABLE, 0, 0, DEFAULT_STORAGE_DESCRIPTOR, ImmutableMap.of()); } catch (MetaException e) { throw new RuntimeException(e); } }); }
@Override public List<Partition> getPartitionsByNames(String dbName, String tableName, List<String> names) throws TException { accessCount.incrementAndGet(); if (throwException) { throw new RuntimeException(); } if (!dbName.equals(TEST_DATABASE) || !tableName.equals(TEST_TABLE) || !ImmutableSet.of(TEST_PARTITION1, TEST_PARTITION2).containsAll(names)) { throw new NoSuchObjectException(); } return Lists.transform(names, name -> { try { return new Partition(ImmutableList.copyOf(Warehouse.getPartValuesFromPartName(name)), TEST_DATABASE, TEST_TABLE, 0, 0, DEFAULT_STORAGE_DESCRIPTOR, ImmutableMap.of()); } catch (MetaException e) { throw new RuntimeException(e); } }); }
@Override public List<Partition> getPartitionsByNames(String dbName, String tableName, List<String> names) throws TException { accessCount.incrementAndGet(); if (throwException) { throw new RuntimeException(); } if (!dbName.equals(TEST_DATABASE) || !tableName.equals(TEST_TABLE) || !ImmutableSet.of(TEST_PARTITION1, TEST_PARTITION2).containsAll(names)) { throw new NoSuchObjectException(); } return Lists.transform(names, name -> { try { return new Partition(ImmutableList.copyOf(Warehouse.getPartValuesFromPartName(name)), TEST_DATABASE, TEST_TABLE, 0, 0, DEFAULT_STORAGE_DESCRIPTOR, ImmutableMap.of()); } catch (MetaException e) { throw new RuntimeException(e); } }); }
@Override public List<Partition> getPartitionsByNames(String dbName, String tableName, List<String> names) throws TException { accessCount.incrementAndGet(); if (throwException) { throw new RuntimeException(); } if (!dbName.equals(TEST_DATABASE) || !tableName.equals(TEST_TABLE) || !ImmutableSet.of(TEST_PARTITION1, TEST_PARTITION2).containsAll(names)) { throw new NoSuchObjectException(); } return Lists.transform(names, name -> { try { return new Partition(ImmutableList.copyOf(Warehouse.getPartValuesFromPartName(name)), TEST_DATABASE, TEST_TABLE, 0, 0, null, null); } catch (MetaException e) { throw Throwables.propagate(e); } }); }
try { validatePartitionNameCharacters( Warehouse.getPartValuesFromPartName(s.getPath().getParent().toString())); } catch (MetaException e) { throw new HiveException(e);
partName = Warehouse .makePartName(hiveObjectDesc.getPartSpec(), false); partValues = Warehouse.getPartValuesFromPartName(partName);