use of org.apache.hadoop.hive.metastore.api.PartitionsByExprRequest in project hive by apache.
the class TestSessionHiveMetastoreClientListPartitionsTempTable method testListPartitionsSpecByExprNullTblName.
@Test(expected = MetaException.class)
public void testListPartitionsSpecByExprNullTblName() throws Exception {
PartitionsByExprRequest req = new PartitionsByExprRequest(DB_NAME, null, ByteBuffer.wrap(new byte[] { 'f', 'o', 'o' }));
req.setMaxParts((short) -1);
getClient().listPartitionsSpecByExpr(req, null);
}
use of org.apache.hadoop.hive.metastore.api.PartitionsByExprRequest in project hive by apache.
the class TestSessionHiveMetastoreClientListPartitionsTempTable method testListPartitionsSpecByExprNullDbName.
@Test(expected = MetaException.class)
public void testListPartitionsSpecByExprNullDbName() throws Exception {
PartitionsByExprRequest req = new PartitionsByExprRequest(null, TABLE_NAME, ByteBuffer.wrap(new byte[] { 'f', 'o', 'o' }));
req.setMaxParts((short) -1);
getClient().listPartitionsSpecByExpr(req, null);
}
use of org.apache.hadoop.hive.metastore.api.PartitionsByExprRequest in project hive by apache.
the class TestSessionHiveMetastoreClientListPartitionsTempTable method testListPartitionsSpecByExprNullResult.
@Test(expected = AssertionError.class)
public void testListPartitionsSpecByExprNullResult() throws Exception {
Table t = createTable4PartColsParts(getClient()).table;
TestMetastoreExpr.ExprBuilder e = new TestMetastoreExpr.ExprBuilder(TABLE_NAME);
PartitionsByExprRequest req = new PartitionsByExprRequest(DB_NAME, TABLE_NAME, ByteBuffer.wrap(SerializationUtilities.serializeExpressionToKryo(e.strCol("yyyy").val("2017").pred("=", 2).build())));
req.setMaxParts((short) -1);
req.setId(t.getId());
getClient().listPartitionsSpecByExpr(req, null);
}
use of org.apache.hadoop.hive.metastore.api.PartitionsByExprRequest in project hive by apache.
the class TestSessionHiveMetastoreClientListPartitionsTempTable method testListPartitionsSpecByExprHighMaxParts.
@Test
public void testListPartitionsSpecByExprHighMaxParts() throws Exception {
Table t = createTable4PartColsParts(getClient()).table;
TestMetastoreExpr.ExprBuilder e = new TestMetastoreExpr.ExprBuilder(TABLE_NAME);
List<PartitionSpec> result = new ArrayList<>();
PartitionsByExprRequest req = new PartitionsByExprRequest(DB_NAME, TABLE_NAME, ByteBuffer.wrap(SerializationUtilities.serializeExpressionToKryo(e.strCol("yyyy").val("2017").pred(">=", 2).build())));
req.setMaxParts((short) 100);
req.setId(t.getId());
getClient().listPartitionsSpecByExpr(req, result);
assertEquals(4, result.iterator().next().getSharedSDPartitionSpec().getPartitionsSize());
}
use of org.apache.hadoop.hive.metastore.api.PartitionsByExprRequest in project hive by apache.
the class TestSessionHiveMetastoreClientListPartitionsTempTable method testListPartitionsSpecByExprNoTbl.
@Test(expected = NoSuchObjectException.class)
public void testListPartitionsSpecByExprNoTbl() throws Exception {
PartitionsByExprRequest req = new PartitionsByExprRequest(DB_NAME, TABLE_NAME, ByteBuffer.wrap(new byte[] { 'f', 'o', 'o' }));
req.setMaxParts((short) -1);
getClient().listPartitionsSpecByExpr(req, new ArrayList<>());
}
Aggregations