[
https://issues.apache.org/jira/browse/PHOENIX-3610?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ankit Singhal updated PHOENIX-3610:
-----------------------------------
Description:
Physical Tablename is used instead of phoenix table name .
IndexHalfStoreFileReaderGenerator#preStoreFileReaderOpen
{code}
TableName tableName =
ctx.getEnvironment().getRegion().getTableDesc().getTableName();
..............
try {
conn =
QueryUtil.getConnectionOnServer(ctx.getEnvironment().getConfiguration()).unwrap(
PhoenixConnection.class);
PTable dataTable = PhoenixRuntime.getTableNoCache(conn,
tableName.getNameAsString());
List<PTable> indexes = dataTable.getIndexes();
Map<ImmutableBytesWritable, IndexMaintainer> indexMaintainers =
new HashMap<ImmutableBytesWritable, IndexMaintainer>();
for (PTable index : indexes) {
if (index.getIndexType() == IndexType.LOCAL) {
IndexMaintainer indexMaintainer =
index.getIndexMaintainer(dataTable, conn);
indexMaintainers.put(new
ImmutableBytesWritable(MetaDataUtil
.getViewIndexIdDataType().toBytes(index.getViewIndexId())),
indexMaintainer);
}
}
if(indexMaintainers.isEmpty()) return reader;
byte[][] viewConstants = getViewConstants(dataTable);
return new IndexHalfStoreFileReader(fs, p, cacheConf, in, size,
r, ctx
.getEnvironment().getConfiguration(), indexMaintainers,
viewConstants,
childRegion, regionStartKeyInHFile, splitKey);
{code}
was:
Physical Tablename is used instead of phoenix table name .
{code}
TableName tableName =
ctx.getEnvironment().getRegion().getTableDesc().getTableName();
......
.........
try {
conn =
QueryUtil.getConnectionOnServer(ctx.getEnvironment().getConfiguration()).unwrap(
PhoenixConnection.class);
PTable dataTable = PhoenixRuntime.getTableNoCache(conn,
tableName.getNameAsString());
List<PTable> indexes = dataTable.getIndexes();
Map<ImmutableBytesWritable, IndexMaintainer> indexMaintainers =
new HashMap<ImmutableBytesWritable, IndexMaintainer>();
for (PTable index : indexes) {
if (index.getIndexType() == IndexType.LOCAL) {
IndexMaintainer indexMaintainer =
index.getIndexMaintainer(dataTable, conn);
indexMaintainers.put(new
ImmutableBytesWritable(MetaDataUtil
.getViewIndexIdDataType().toBytes(index.getViewIndexId())),
indexMaintainer);
}
}
if(indexMaintainers.isEmpty()) return reader;
byte[][] viewConstants = getViewConstants(dataTable);
return new IndexHalfStoreFileReader(fs, p, cacheConf, in, size,
r, ctx
.getEnvironment().getConfiguration(), indexMaintainers,
viewConstants,
childRegion, regionStartKeyInHFile, splitKey);
{code]
> Fix tableName used to get the index maintainers while creating
> HalfStoreFileReader for local index store
> --------------------------------------------------------------------------------------------------------
>
> Key: PHOENIX-3610
> URL: https://issues.apache.org/jira/browse/PHOENIX-3610
> Project: Phoenix
> Issue Type: Bug
> Reporter: Ankit Singhal
> Assignee: Ankit Singhal
> Fix For: 4.10.0
>
>
> Physical Tablename is used instead of phoenix table name .
> IndexHalfStoreFileReaderGenerator#preStoreFileReaderOpen
> {code}
> TableName tableName =
> ctx.getEnvironment().getRegion().getTableDesc().getTableName();
> ..............
> try {
> conn =
> QueryUtil.getConnectionOnServer(ctx.getEnvironment().getConfiguration()).unwrap(
> PhoenixConnection.class);
> PTable dataTable = PhoenixRuntime.getTableNoCache(conn,
> tableName.getNameAsString());
> List<PTable> indexes = dataTable.getIndexes();
> Map<ImmutableBytesWritable, IndexMaintainer> indexMaintainers
> =
> new HashMap<ImmutableBytesWritable,
> IndexMaintainer>();
> for (PTable index : indexes) {
> if (index.getIndexType() == IndexType.LOCAL) {
> IndexMaintainer indexMaintainer =
> index.getIndexMaintainer(dataTable, conn);
> indexMaintainers.put(new
> ImmutableBytesWritable(MetaDataUtil
>
> .getViewIndexIdDataType().toBytes(index.getViewIndexId())),
> indexMaintainer);
> }
> }
> if(indexMaintainers.isEmpty()) return reader;
> byte[][] viewConstants = getViewConstants(dataTable);
> return new IndexHalfStoreFileReader(fs, p, cacheConf, in,
> size, r, ctx
> .getEnvironment().getConfiguration(),
> indexMaintainers, viewConstants,
> childRegion, regionStartKeyInHFile, splitKey);
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)