use of com.netflix.metacat.common.server.partition.visitor.PartitionParamParserEval in project metacat by Netflix.
the class HiveConnectorFastPartitionService method getDateCreatedSqlCriteria.
private String getDateCreatedSqlCriteria(final String filterExpression) {
final StringBuilder result = new StringBuilder();
Collection<String> values = Lists.newArrayList();
if (!Strings.isNullOrEmpty(filterExpression)) {
try {
values = (Collection<String>) new PartitionParser(new StringReader(filterExpression)).filter().jjtAccept(new PartitionParamParserEval(), null);
} catch (Throwable ignored) {
//
}
}
for (String value : values) {
if (result.length() != 0) {
result.append(" and ");
}
result.append(value.replace("dateCreated", "p.CREATE_TIME"));
}
return result.toString();
}
use of com.netflix.metacat.common.server.partition.visitor.PartitionParamParserEval in project metacat by Netflix.
the class DirectSqlGetPartition method getDateCreatedSqlCriteria.
private String getDateCreatedSqlCriteria(final String filterExpression) {
final StringBuilder result = new StringBuilder();
Collection<String> values = Lists.newArrayList();
if (!Strings.isNullOrEmpty(filterExpression)) {
try {
values = (Collection<String>) new PartitionParser(new StringReader(filterExpression)).filter().jjtAccept(new PartitionParamParserEval(), null);
} catch (Throwable ignored) {
//
}
}
for (String value : values) {
if (result.length() != 0) {
result.append(" and ");
}
result.append(value.replace("dateCreated", "p.CREATE_TIME"));
}
return result.toString();
}
use of com.netflix.metacat.common.server.partition.visitor.PartitionParamParserEval in project metacat by Netflix.
the class S3ConnectorPartitionService method getDateCreatedSqlCriteria.
private String getDateCreatedSqlCriteria(final String filterExpression) {
final StringBuilder result = new StringBuilder();
Collection<String> values = com.google.common.collect.Lists.newArrayList();
if (!Strings.isNullOrEmpty(filterExpression)) {
try {
values = (Collection<String>) new PartitionParser(new StringReader(filterExpression)).filter().jjtAccept(new PartitionParamParserEval(), null);
} catch (Throwable ignored) {
//
}
}
for (String value : values) {
if (result.length() != 0) {
result.append(" and ");
}
result.append(value.replace("dateCreated", "to_seconds(p.date_created)"));
}
return result.toString();
}
Aggregations