Constructor and Description |
---|
JoinCandidate(Candidate childCandidate1,
Candidate childCandidate2,
CubeQueryContext cubeql) |
Modifier and Type | Method and Description |
---|---|
void |
addAnswerableMeasurePhraseIndices(int index)
Add `index` as answerable index in a pre-decided list of queried phrases.
|
boolean |
contains(Candidate candidate)
Returns true if this candidate contains the given candidate
|
Set<Integer> |
decideMeasurePhrasesToAnswer(Set<Integer> measureIndices) |
boolean |
evaluateCompleteness(TimeRange timeRange,
TimeRange parentTimeRange,
boolean failOnPartialData)
Calculates if this candidate can answer the query for given time range based on actual data registered with
the underlying candidate storages.
|
JoinCandidate |
explode()
Explode this candidate into another candidate.
|
Set<Integer> |
getAnswerableMeasurePhraseIndices()
Gets the index positions of answerable measure phrases in CubeQueryContext#selectPhrases
|
List<Candidate> |
getChildren()
Child candidates that will participate in the join
|
Optional<Date> |
getColumnEndTime(String column)
This method should give end time of a column, if there's any.
|
Collection<String> |
getColumns()
Returns all the fact columns
|
Optional<Date> |
getColumnStartTime(String column)
This method should give start time of a column, if there's any.
|
OptionalDouble |
getCost() |
CubeQueryContext |
getCubeQueryContext()
A candidate always works along with its cube query context.
|
Date |
getEndTime()
End Time for this candidate (calculated based on schema)
|
Set<FactPartition> |
getParticipatingPartitions()
Returns the set of fact partitions that will participate in this candidate.
|
Date |
getStartTime()
Start Time for this candidate (calculated based on schema)
|
boolean |
isDimAttributeEvaluable(String dim)
Checks whether a dim attribute is evaluable by this candidate
|
boolean |
isExpressionEvaluable(org.apache.lens.cube.parse.ExpressionResolver.ExpressionContext expr)
Checks whether an expression is evaluable by this candidate
1.
|
boolean |
isExpressionEvaluable(String expr)
Checks whether an expression is evaluable by this candidate
1.
|
boolean |
isPhraseAnswerable(org.apache.lens.cube.parse.QueriedPhraseContext phrase)
Checks whether the given queries phrase is evaluable by this candidate
|
boolean |
isTimeRangeCoverable(TimeRange timeRange)
Is time range coverable based on start and end times configured in schema for the composing storage candidates
and valid update periods.
|
String |
toString() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
copy, coveredPhrases, getChildrenCount, getConf, getCube, getCubeMetastoreClient, hasColumn, isColumnPresentAndValidForRange, isColumnValidForRange, isCompletelyValidForTimeRanges, isPartiallyValidForTimeRange, isPartiallyValidForTimeRanges, toQueryWriterContext, updateStorageCandidateQueriablePhraseIndices
public JoinCandidate(Candidate childCandidate1, Candidate childCandidate2, CubeQueryContext cubeql)
public Collection<String> getColumns()
Candidate
getColumns
in interface Candidate
public Date getStartTime()
Candidate
getStartTime
in interface Candidate
public Date getEndTime()
Candidate
getEndTime
in interface Candidate
public OptionalDouble getCost()
public boolean contains(Candidate candidate)
Candidate
public boolean evaluateCompleteness(TimeRange timeRange, TimeRange parentTimeRange, boolean failOnPartialData) throws LensException
Candidate
Candidate.getParticipatingPartitions()
.evaluateCompleteness
in interface Candidate
timeRange
- : TimeRange to check completeness for. TimeRange consists of start time, end time and the
partition columnparentTimeRange
- : User quried timerangefailOnPartialData
- : fail fast if the candidate can answer the query only partiallyLensException
public Set<FactPartition> getParticipatingPartitions()
Candidate
Candidate.evaluateCompleteness(TimeRange, TimeRange, boolean)
getParticipatingPartitions
in interface Candidate
public boolean isExpressionEvaluable(org.apache.lens.cube.parse.ExpressionResolver.ExpressionContext expr)
Candidate
isExpressionEvaluable
in interface Candidate
expr
- Expression to be evaluated for Candidatepublic boolean isExpressionEvaluable(String expr)
Candidate
isExpressionEvaluable
in interface Candidate
expr
- Expression to be evaluated for Candidatepublic boolean isDimAttributeEvaluable(String dim) throws LensException
Candidate
isDimAttributeEvaluable
in interface Candidate
dim
- dim attributeLensException
- propageted exceptionpublic Set<Integer> getAnswerableMeasurePhraseIndices()
Candidate
getAnswerableMeasurePhraseIndices
in interface Candidate
public boolean isPhraseAnswerable(org.apache.lens.cube.parse.QueriedPhraseContext phrase) throws LensException
Candidate
isPhraseAnswerable
in interface Candidate
phrase
- Phrase to checkLensException
- propagated exceptionpublic void addAnswerableMeasurePhraseIndices(int index)
Candidate
addAnswerableMeasurePhraseIndices
in interface Candidate
index
- index to mark as answerablepublic Optional<Date> getColumnStartTime(String column)
Candidate
getColumnStartTime
in interface Candidate
column
- column namepublic Optional<Date> getColumnEndTime(String column)
Candidate
getColumnEndTime
in interface Candidate
column
- column namepublic boolean isTimeRangeCoverable(TimeRange timeRange) throws LensException
Candidate
Candidate.evaluateCompleteness(TimeRange, TimeRange, boolean)
.
isTimeRangeCoverable checks the the possibility of covering time range from schema perspective by using valid
storages/update periods while evaluateCompleteness checks if a time range can be covered based on
registered partitions. So isTimeRangeCoverable = false implies evaluateCompleteness = false but vice versa is
not true.isTimeRangeCoverable
in interface Candidate
timeRange
- The time range to checkLensException
- propagated exceptionspublic JoinCandidate explode() throws LensException
Candidate
explode
in interface Candidate
LensException
public Set<Integer> decideMeasurePhrasesToAnswer(Set<Integer> measureIndices) throws LensException
decideMeasurePhrasesToAnswer
in interface Candidate
LensException
@Generated(value="lombok") public List<Candidate> getChildren()
getChildren
in interface Candidate
@Generated(value="lombok") public CubeQueryContext getCubeQueryContext()
Candidate
getCubeQueryContext
in interface Candidate
Copyright © 2014–2018 Apache Software Foundation. All rights reserved.