use of io.hetu.core.plugin.hbase.query.HBaseRecordSet in project hetu-core by openlookeng.
the class TestQuery method testHBaseRecordSetGetFiltersFromDomains.
/**
* testHBaseRecordSetGetFiltersFromDomains
*/
@Test
public void testHBaseRecordSetGetFiltersFromDomains() {
List<HBaseColumnHandle> list = new ArrayList<>();
list.add(TestUtils.createHBaseColumnRowId("rowkey"));
HBaseTableHandle tableHandle = new HBaseTableHandle("hbase", "test_table", "rowkey", false, "io.hetu.core.plugin.hbase.utils.serializers.StringRowSerializer", Optional.of("test_table"), "", null, list, 0, OptionalLong.empty());
// case ABOVE
Map<Integer, List<Range>> ranges = new HashMap<>();
long startRow = 1;
long endRow = 12345678;
List<Range> range = new ArrayList<>();
range.add(new Range(Marker.above(BIGINT, startRow), Marker.below(BIGINT, endRow)));
ranges.put(0, range);
HBaseSplit hBasesplit = new HBaseSplit("rowkey", tableHandle, new ArrayList<HostAddress>(1), "1", "12345678", ranges, -1, false, null);
HBaseRecordSet rSet = new HBaseRecordSet(hconn, session, hBasesplit, tableHandle, list);
rSet.getFiltersFromDomains(ranges);
// List<Range> is null
ranges.clear();
ranges.put(0, null);
rSet.getFiltersFromDomains(ranges);
// case EXACTLY
range.clear();
ranges.clear();
long exactly = 12345678;
range.add(Range.equal(BIGINT, exactly));
ranges.put(0, range);
rSet.getFiltersFromDomains(ranges);
// other case
range.add(Range.range(BIGINT, exactly, true, exactly * 2, true));
ranges.put(1, range);
list.add(TestUtils.createHBaseColumnHandle("a", "f_a", "q_a", 1));
HBaseRecordSet rSet2Column = new HBaseRecordSet(hconn, session, hBasesplit, tableHandle, list);
rSet2Column.getFiltersFromDomains(ranges);
}
use of io.hetu.core.plugin.hbase.query.HBaseRecordSet in project hetu-core by openlookeng.
the class TestQuery method setUp.
/**
* setUp
*/
@BeforeClass
public void setUp() {
hCConf.setZkClientPort("2181");
hCConf.setZkQuorum("zk1");
hetuMetastore = new TestingHetuMetastore();
hconn = new TestHBaseClientConnection(hCConf, hetuMetastore.getHetuMetastore());
hconn.createConnection();
session = new TestingConnectorSession("root");
split = new HBaseSplit("rowKey", TestUtils.createHBaseTableHandle(), new ArrayList<HostAddress>(1), "startrow", "endrow", new HashMap<>(), -1, false, null);
recordSet = new HBaseRecordSet(hconn, session, split, TestUtils.createHBaseTableHandle(), TestUtils.createColumnList());
}
use of io.hetu.core.plugin.hbase.query.HBaseRecordSet in project hetu-core by openlookeng.
the class TestQuery method testHBaseRecordSetCursorIsBatchGet.
/**
* testHBaseRecordSetCursorIsBatchGet
*/
@Test
public void testHBaseRecordSetCursorIsBatchGet() {
HBaseTableHandle tableHandle = new HBaseTableHandle("hbase", "test_table", "rowkey", false, "io.hetu.core.plugin.hbase.utils.serializers.StringRowSerializer", Optional.of("test_table"), "", TestUtils.createTupleDomain(1), TestUtils.createColumnList(), 0, OptionalLong.empty());
HBaseSplit hBasesplit = new HBaseSplit("rowKey", tableHandle, new ArrayList<HostAddress>(1), "startrow", "endrow", new HashMap<>(), -1, false, null);
HBaseRecordSet rSet = new HBaseRecordSet(hconn, session, hBasesplit, tableHandle, TestUtils.createColumnList());
rSet.cursor();
}
Aggregations