Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
Signed-off-by: Bharathwaj G <[email protected]>
  • Loading branch information
bharath-techie committed Feb 8, 2024
1 parent 722e6cb commit a9ea4cc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@
/** Base class for star tree builder */
public abstract class BaseSingleTreeBuilder {
public static final int STAR_IN_DOC_VALUES_INDEX = -1;
public final static long SECOND = 1000;
public final static long SECOND = 1;// HTTP codec
public final static long MINUTE = 60 * SECOND;
public final static long HOUR = 60 * 60 * SECOND;
public final static long DAY = 24 * HOUR;
public final static long MONTH = 30 * DAY;
public final static long YEAR = 365 * DAY;
private static final Logger logger = LogManager.getLogger(BaseSingleTreeBuilder.class);
final int _numDimensions;
Expand Down Expand Up @@ -97,8 +98,8 @@ public abstract class BaseSingleTreeBuilder {
dimensionsSplitOrder = new ArrayList<>();
dimensionsSplitOrder.add("minute");
dimensionsSplitOrder.add("hour");
dimensionsSplitOrder.add("day");
dimensionsSplitOrder.add("month");
//dimensionsSplitOrder.add("day");
//dimensionsSplitOrder.add("month");
// dimensionsSplitOrder.add("year");
dimensionsSplitOrder.add("status");
_numDimensions = dimensionsSplitOrder.size();
Expand Down Expand Up @@ -567,15 +568,16 @@ Record getNextSegmentRecord() throws IOException {
private long getTimeStampVal(final String fieldName, final long val) {
switch (fieldName) {
case "minute":
return val / MINUTE * MINUTE;
return val / MINUTE;// * MINUTE;
case "hour":
return val / HOUR * HOUR;
logger.info( "hour: " + (val/HOUR));
return val / HOUR;// * HOUR;
case "day":
return val / DAY * DAY;
return val / DAY;// * DAY;
case "month":
return DateUtils.roundMonthOfYear(val); // TODO
return val / MONTH;// * MONTH; // TODO
case "year":
return DateUtils.roundYear(val);
return val / YEAR;// * YEAR;
default:
return val;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public StarTreeFilter(
* <li>For the remaining columns, use other indexes to match them
* </ul>
*/

// 1706268600 / (60*60*1000) * (60*60*1000)
public DocIdSetIterator getStarTreeResult() throws IOException {
StarTreeResult starTreeResult = traverseStarTree();
List<DocIdSetIterator> andIterators = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ private String getKey(Map<String, NumericDocValues> fieldColsMap, int doc) throw
for (Map.Entry<String, NumericDocValues> fieldEntry : fieldColsMap.entrySet()) {
fieldEntry.getValue().advanceExact(doc);
long val = fieldEntry.getValue().longValue();
System.out.println("Key field : " + fieldEntry.getKey() + " Value : " + val);
sj.add("" + val);
}
return sj.toString();
Expand Down

0 comments on commit a9ea4cc

Please sign in to comment.