asterixdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yingyi Bu (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (ASTERIXDB-1088) handleCompactStatement() in AqlTranslator.java has a bug
Date Mon, 14 Sep 2015 17:10:45 GMT

     [ https://issues.apache.org/jira/browse/ASTERIXDB-1088?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Yingyi Bu reassigned ASTERIXDB-1088:
------------------------------------

    Assignee: Yingyi Bu

> handleCompactStatement() in AqlTranslator.java has a bug
> --------------------------------------------------------
>
>                 Key: ASTERIXDB-1088
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1088
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: AsterixDB, Storage, Translator - AQL
>            Reporter: Young-Seok Kim
>            Assignee: Yingyi Bu
>
> The following code in handleCompactStatement() in AqlTranslator.java 
> (https://github.com/apache/incubator-asterixdb/blob/master/asterix-app/src/main/java/org/apache/asterix/aql/translator/AqlTranslator.java)
> 1) doesn't compact secondary indexes if any
> 2) instead compact primary index as many as the number of secondary indexes. 
> from line 2421.
>             if (ds.getDatasetType() == DatasetType.INTERNAL) {
>                 for (int j = 0; j < indexes.size(); j++) {
>                     if (indexes.get(j).isSecondaryIndex()) {
>                         CompiledIndexCompactStatement cics = new CompiledIndexCompactStatement(dataverseName,
>                                 datasetName, indexes.get(j).getIndexName(), indexes.get(j).getKeyFieldNames(),
indexes
>                                         .get(j).getKeyFieldTypes(), indexes.get(j).isEnforcingKeyFileds(),
indexes.get(
>                                         j).getGramLength(), indexes.get(j).getIndexType());
>                         Dataverse dataverse = MetadataManager.INSTANCE.getDataverse(
>                                 metadataProvider.getMetadataTxnContext(), dataverseName);
>                         jobsToExecute.add(DatasetOperations.compactDatasetJobSpec(dataverse,
datasetName,
>                                 metadataProvider));
>                     }
>                 }
> The code should fixed something as follows:
>             if (ds.getDatasetType() == DatasetType.INTERNAL) {
>                 for (int j = 0; j < indexes.size(); j++) {
>                     if (indexes.get(j).isSecondaryIndex()) {
>                 		
>                         CompiledIndexCompactStatement cics = new CompiledIndexCompactStatement(dataverseName,
>                                 datasetName, indexes.get(j).getIndexName(), indexes.get(j).getKeyFieldNames(),

>                                 indexes.get(j).getKeyFieldTypes(), indexes.get(j).getIndexType(),
null,
>                                 indexes.get(j).isEnforcingKeyFileds());
>                         jobsToExecute.add(IndexOperations.buildSecondaryIndexCompactJobSpec(cics,
metadataProvider, ds));
>                     }
>                 }
>                 Dataverse dataverse = MetadataManager.INSTANCE.getDataverse(
>                         metadataProvider.getMetadataTxnContext(), dataverseName);
>                 jobsToExecute.add(DatasetOperations.compactDatasetJobSpec(dataverse,
datasetName,
>                         metadataProvider));



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message