Package com.foundationdb.qp.operator

Examples of com.foundationdb.qp.operator.Operator


    }

    @Test
    public void testMixedSome_DAA()
    {
        Operator plan = indexScan_Default(idxRowType, unbounded(), ordering(A, DESC, B, ASC, C, ASC));
        Row[] expected = new Row[]{
            row(idxRowType, 3L, null, null, 2003L),
            row(idxRowType, 3L, null, 5L, 2002L),
            row(idxRowType, 3L, 4L, null, 2001L),
            row(idxRowType, 3L, 4L, 5L, 2000L),
View Full Code Here


    }

    @Test
    public void testMixedSome_DA()
    {
        Operator plan = indexScan_Default(idxRowType, unbounded(), ordering(A, DESC, B, ASC));
        Row[] expected = new Row[]{
            row(idxRowType, 3L, null, null, 2003L),
            row(idxRowType, 3L, null, 5L, 2002L),
            row(idxRowType, 3L, 4L, null, 2001L),
            row(idxRowType, 3L, 4L, 5L, 2000L),
View Full Code Here

    }

    @Test
    public void testMixedAll_DADA()
    {
        Operator plan = indexScan_Default(idxRowType, unbounded(), ordering(A, DESC, B, ASC, C, DESC, ID, ASC));
        Row[] expected = new Row[]{
            row(idxRowType, 3L, null, 5L, 2002L),
            row(idxRowType, 3L, null, null, 2003L),
            row(idxRowType, 3L, 4L, 5L, 2000L),
            row(idxRowType, 3L, 4L, null, 2001L),
View Full Code Here

    }

    @Test
    public void testMixedSome_DAD()
    {
        Operator plan = indexScan_Default(idxRowType, unbounded(), ordering(A, DESC, B, ASC, C, DESC));
        Row[] expected = new Row[]{
            row(idxRowType, 3L, null, 5L, 2002L),
            row(idxRowType, 3L, null, null, 2003L),
            row(idxRowType, 3L, 4L, 5L, 2000L),
            row(idxRowType, 3L, 4L, null, 2001L),
View Full Code Here

    }

    @Test
    public void testMixedAll_DDAA()
    {
        Operator plan = indexScan_Default(idxRowType, unbounded(), ordering(A, DESC, B, DESC, C, ASC, ID, ASC));
        Row[] expected = new Row[]{
            row(idxRowType, 3L, 4L, null, 2001L),
            row(idxRowType, 3L, 4L, 5L, 2000L),
            row(idxRowType, 3L, null, null, 2003L),
            row(idxRowType, 3L, null, 5L, 2002L),
View Full Code Here

    }

    @Test
    public void testMixedSome_DDA()
    {
        Operator plan = indexScan_Default(idxRowType, unbounded(), ordering(A, DESC, B, DESC, C, ASC));
        Row[] expected = new Row[]{
            row(idxRowType, 3L, 4L, null, 2001L),
            row(idxRowType, 3L, 4L, 5L, 2000L),
            row(idxRowType, 3L, null, null, 2003L),
            row(idxRowType, 3L, null, 5L, 2002L),
View Full Code Here

    }

    @Test
    public void testMixedAll_DDDA()
    {
        Operator plan = indexScan_Default(idxRowType, unbounded(), ordering(A, DESC, B, DESC, C, DESC, ID, ASC));
        Row[] expected = new Row[]{
            row(idxRowType, 3L, 4L, 5L, 2000L),
            row(idxRowType, 3L, 4L, null, 2001L),
            row(idxRowType, 3L, null, 5L, 2002L),
            row(idxRowType, 3L, null, null, 2003L),
View Full Code Here

    // TODO: If inner input has rows of unexpected types, (not of innerType), should an IncompatibleRowException be thrown?

    @Test
    public void testProductAfterIndexScanOfRoot()
    {
        Operator flattenCO =
            flatten_HKeyOrdered(
                filter_Default(
                    branchLookup_Default(
                        ancestorLookup_Default(
                            indexScan_Default(customerNameIndexRowType, false),
                            coi,
                            customerNameIndexRowType,
                            Collections.singleton(customerRowType),
                            InputPreservationOption.DISCARD_INPUT),
                        coi,
                        customerRowType,
                        orderRowType,
                        InputPreservationOption.KEEP_INPUT),
                    removeDescendentTypes(orderRowType)),
                customerRowType,
                orderRowType,
                INNER_JOIN);
        Operator flattenCA =
            flatten_HKeyOrdered(
                branchLookup_Nested(coi, flattenCO.rowType(), customerRowType, null, list(addressRowType), InputPreservationOption.KEEP_INPUT, 0, lookaheadQuantum()),
                customerRowType,
                addressRowType,
                INNER_JOIN);
        Operator product = product_Nested(flattenCA, flattenCO.rowType(), null, flattenCA.rowType(), 0);
        RowType coaRowType = product.rowType();
        checkRowTypeFields(null, coaRowType,
                MNumeric.INT.instance(false),
                MString.VARCHAR.instance(20, true),
                MNumeric.INT.instance(false),
                MNumeric.INT.instance(true),
                MString.VARCHAR.instance(20, true),
                MNumeric.INT.instance(false),
                MNumeric.INT.instance(true),
                MString.VARCHAR.instance(100, true));
       
        Operator plan = map_NestedLoops(flattenCO, product, 0, pipelineMap(), 1);
        Cursor cursor = cursor(plan, queryContext, queryBindings);
        Row[] expected = new Row[]{
            row(coaRowType, 2L, "foundation", 200L, 2L, "david", 2000L, 2L, "222 2000 st"),
            row(coaRowType, 2L, "foundation", 201L, 2L, "david", 2000L, 2L, "222 2000 st"),
            row(coaRowType, 3L, "matrix", 300L, 3L, "tom", 3000L, 3L, "333 3000 st"),
View Full Code Here

    }

    @Test
    public void testProductAfterIndexScanOfNonRoot()
    {
        Operator flattenCO =
            flatten_HKeyOrdered(
                ancestorLookup_Default(
                    indexScan_Default(orderSalesmanIndexRowType, false),
                    coi,
                    orderSalesmanIndexRowType,
                    Arrays.asList(orderRowType, customerRowType),
                    InputPreservationOption.DISCARD_INPUT),
                customerRowType,
                orderRowType,
                INNER_JOIN);
        Operator flattenCA =
            flatten_HKeyOrdered(
                branchLookup_Nested(coi, flattenCO.rowType(), customerRowType, null, list(addressRowType), InputPreservationOption.KEEP_INPUT, 0, lookaheadQuantum()),
                customerRowType,
                addressRowType,
                INNER_JOIN);
        Operator product = product_Nested(flattenCA, flattenCO.rowType(), null, flattenCA.rowType(), 0);
        RowType coaRowType = product.rowType();
       
        checkRowTypeFields(null, coaRowType,
                MNumeric.INT.instance(false),
                MString.VARCHAR.instance(20, true),
                MNumeric.INT.instance(false),
                MNumeric.INT.instance(true),
                MString.VARCHAR.instance(20, true),
                MNumeric.INT.instance(false),
                MNumeric.INT.instance(true),
                MString.VARCHAR.instance(100, true));
       
        Operator plan = map_NestedLoops(flattenCO, product, 0, pipelineMap(), 1);
        Cursor cursor = cursor(plan, queryContext, queryBindings);
        Row[] expected = new Row[]{
            row(coaRowType, 2L, "foundation", 200L, 2L, "david", 2000L, 2L, "222 2000 st"),
            row(coaRowType, 2L, "foundation", 201L, 2L, "david", 2000L, 2L, "222 2000 st"),
            row(coaRowType, 1L, "northbridge", 100L, 1L, "ori", 1000L, 1L, "111 1000 st"),
View Full Code Here

    }

    @Test
    public void testProductOfTwoOccurrencesOfSameBranch()
    {
        Operator flattenCAOuter =
            flatten_HKeyOrdered(
                filter_Default(
                    groupScan_Default(coi),
                    Arrays.asList(customerRowType, addressRowType)),
                customerRowType,
                addressRowType,
                JoinType.LEFT_JOIN);
        Operator flattenCAInner =
            flatten_HKeyOrdered(
                branchLookup_Nested(
                    coi,
                    flattenCAOuter.rowType(),
                    customerRowType,
                    customerRowType,
                    list(addressRowType),
                    InputPreservationOption.KEEP_INPUT,
                    0,
                    lookaheadQuantum()),
                customerRowType,
                addressRowType,
                JoinType.LEFT_JOIN);
        Operator product =
            product_Nested(
                flattenCAInner,
                flattenCAOuter.rowType(),
                customerRowType,
                flattenCAInner.rowType(),
                0);
        RowType productRowType = product.rowType();
        Operator plan = map_NestedLoops(flattenCAOuter, product, 0, pipelineMap(), 1);
        Row[] expected = new Row[]{
            row(productRowType, 1L, "northbridge", 1000L, 1L, "111 1000 st", 1000L, 1L, "111 1000 st"),
            row(productRowType, 1L, "northbridge", 1000L, 1L, "111 1000 st", 1001L, 1L, "111 1001 st"),
            row(productRowType, 1L, "northbridge", 1001L, 1L, "111 1001 st", 1000L, 1L, "111 1000 st"),
            row(productRowType, 1L, "northbridge", 1001L, 1L, "111 1001 st", 1001L, 1L, "111 1001 st"),
View Full Code Here

TOP

Related Classes of com.foundationdb.qp.operator.Operator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.