本文整理汇总了Java中org.apache.kylin.query.enumerator.OLAPQuery类的典型用法代码示例。如果您正苦于以下问题:Java OLAPQuery类的具体用法?Java OLAPQuery怎么用?Java OLAPQuery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OLAPQuery类属于org.apache.kylin.query.enumerator包,在下文中一共展示了OLAPQuery类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: asQueryable
import org.apache.kylin.query.enumerator.OLAPQuery; //导入依赖的package包/类
@Override
public <T> Queryable<T> asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) {
return new AbstractTableQueryable<T>(queryProvider, schema, this, tableName) {
@SuppressWarnings("unchecked")
public Enumerator<T> enumerator() {
final OLAPQuery query = new OLAPQuery(EnumeratorTypeEnum.OLAP, 0);
return (Enumerator<T>) query.enumerator();
}
};
}
示例2: asQueryable
import org.apache.kylin.query.enumerator.OLAPQuery; //导入依赖的package包/类
@Override
public <T> Queryable<T> asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) {
return new AbstractTableQueryable<T>(queryProvider, schema, this, tableName) {
@SuppressWarnings("unchecked")
public Enumerator<T> enumerator() {
final OLAPQuery query = new OLAPQuery(EnumeratorTypeEnum.INDEX, 0);
return (Enumerator<T>) query.enumerator();
}
};
}
示例3: setUpCubeConn
import org.apache.kylin.query.enumerator.OLAPQuery; //导入依赖的package包/类
private static void setUpCubeConn() throws SQLException {
// Cube Connection
File olapTmp = OLAPSchemaFactory.createTempOLAPJson(ProjectInstance.DEFAULT_PROJECT_NAME, config);
Properties props = new Properties();
props.setProperty(OLAPQuery.PROP_SCAN_THRESHOLD, "10000");
cubeConnection = DriverManager.getConnection("jdbc:calcite:model=" + olapTmp.getAbsolutePath(), props);
}
示例4: getOLAPDataSource
import org.apache.kylin.query.enumerator.OLAPQuery; //导入依赖的package包/类
public DataSource getOLAPDataSource(String project) {
project = ProjectInstance.getNormalizedProjectName(project);
DataSource ret = olapDataSources.get(project);
if (ret == null) {
logger.debug("Creating a new data source");
logger.debug("OLAP data source pointing to " + getConfig());
File modelJson = OLAPSchemaFactory.createTempOLAPJson(project, getConfig());
try {
List<String> text = Files.readLines(modelJson, Charset.defaultCharset());
logger.debug("The new temp olap json is :");
for (String line : text)
logger.debug(line);
} catch (IOException e) {
e.printStackTrace(); // logging failure is not critical
}
DriverManagerDataSource ds = new DriverManagerDataSource();
Properties props = new Properties();
props.setProperty(OLAPQuery.PROP_SCAN_THRESHOLD, String.valueOf(KylinConfig.getInstanceFromEnv().getScanThreshold()));
ds.setConnectionProperties(props);
ds.setDriverClassName("net.hydromatic.optiq.jdbc.Driver");
ds.setUrl("jdbc:calcite:model=" + modelJson.getAbsolutePath());
ret = olapDataSources.putIfAbsent(project, ds);
if (ret == null) {
ret = ds;
}
}
return ret;
}
示例5: executeOLAPQuery
import org.apache.kylin.query.enumerator.OLAPQuery; //导入依赖的package包/类
public Enumerable<Object[]> executeOLAPQuery(DataContext optiqContext, int ctxSeq) {
return new OLAPQuery(optiqContext, EnumeratorTypeEnum.OLAP, ctxSeq);
}
示例6: executeLookupTableQuery
import org.apache.kylin.query.enumerator.OLAPQuery; //导入依赖的package包/类
public Enumerable<Object[]> executeLookupTableQuery(DataContext optiqContext, int ctxSeq) {
return new OLAPQuery(optiqContext, EnumeratorTypeEnum.LOOKUP_TABLE, ctxSeq);
}
示例7: executeHiveQuery
import org.apache.kylin.query.enumerator.OLAPQuery; //导入依赖的package包/类
public Enumerable<Object[]> executeHiveQuery(DataContext optiqContext, int ctxSeq) {
return new OLAPQuery(optiqContext, EnumeratorTypeEnum.HIVE, ctxSeq);
}
示例8: executeIndexQuery
import org.apache.kylin.query.enumerator.OLAPQuery; //导入依赖的package包/类
public Enumerable<Object[]> executeIndexQuery(DataContext optiqContext, int ctxSeq) {
return new OLAPQuery(optiqContext, EnumeratorTypeEnum.INDEX, ctxSeq);
}