Search in sources :

Example 1 with IPrinterFactoryProvider

use of org.apache.hyracks.algebricks.data.IPrinterFactoryProvider in project asterixdb by apache.

the class JobGenHelper method mkPrinterFactories.

public static IPrinterFactory[] mkPrinterFactories(IOperatorSchema opSchema, IVariableTypeEnvironment env, JobGenContext context, int[] printColumns) throws AlgebricksException {
    IPrinterFactory[] pf = new IPrinterFactory[printColumns.length];
    IPrinterFactoryProvider pff = context.getPrinterFactoryProvider();
    try {
        for (int i = 0; i < pf.length; i++) {
            LogicalVariable v = opSchema.getVariable(printColumns[i]);
            Object t = env.getVarType(v);
            pf[i] = pff.getPrinterFactory(t);
        }
        return pf;
    } catch (HyracksDataException e) {
        throw new AlgebricksException(e);
    }
}
Also used : LogicalVariable(org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable) IPrinterFactory(org.apache.hyracks.algebricks.data.IPrinterFactory) IPrinterFactoryProvider(org.apache.hyracks.algebricks.data.IPrinterFactoryProvider) AlgebricksException(org.apache.hyracks.algebricks.common.exceptions.AlgebricksException) HyracksDataException(org.apache.hyracks.api.exceptions.HyracksDataException)

Aggregations

AlgebricksException (org.apache.hyracks.algebricks.common.exceptions.AlgebricksException)1 LogicalVariable (org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable)1 IPrinterFactory (org.apache.hyracks.algebricks.data.IPrinterFactory)1 IPrinterFactoryProvider (org.apache.hyracks.algebricks.data.IPrinterFactoryProvider)1 HyracksDataException (org.apache.hyracks.api.exceptions.HyracksDataException)1