Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-1861

TupleBuffer used in TestProcessor is being treated as a 1 based array.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 7.7
    • Query Engine
    • None
    • Hide

      add test[1] to org.teiid.query.processor.TestProcessor.java and verify results[2].

      [1]
      @Test public void testTupleBufferInTestFramework(){

      String sql = "SELECT 'x1', 'x2', 'x3' FROM pm1.g1";

      // Create expected results - would expect these to be:
      List[] expected = new List[]

      { Arrays.asList("x1", "x2", "x3"), Arrays.asList("x1", "x2", "x3"), Arrays.asList("x1", "x2", "x3"), Arrays.asList("x1", "x2", "x3"), Arrays.asList("x1", "x2", "x3"), Arrays.asList("x1", "x2", "x3"), }

      ;
      // Construct data manager with data
      FakeDataManager dataManager = new FakeDataManager();
      sampleData1(dataManager);

      Command command = helpParse(sql);
      ProcessorPlan plan = helpGetPlan(command, RealMetadataFactory.example1Cached(), TestOptimizer.getGenericFinder(false));
      // Run query
      helpProcess(plan, dataManager, expected);

      }

      [2]
      Results:
      ['x1', 'x2', 'x3']
      0: [x1, x2, null]
      1: [x1, x2, null]
      2: [x1, x2, null]
      3: [x1, x2, null]
      4: [x1, x2, null]
      5: [x1, x2, null]

      Show
      add test [1] to org.teiid.query.processor.TestProcessor.java and verify results [2] . [1] @Test public void testTupleBufferInTestFramework(){ String sql = "SELECT 'x1', 'x2', 'x3' FROM pm1.g1"; // Create expected results - would expect these to be: List[] expected = new List[] { Arrays.asList("x1", "x2", "x3"), Arrays.asList("x1", "x2", "x3"), Arrays.asList("x1", "x2", "x3"), Arrays.asList("x1", "x2", "x3"), Arrays.asList("x1", "x2", "x3"), Arrays.asList("x1", "x2", "x3"), } ; // Construct data manager with data FakeDataManager dataManager = new FakeDataManager(); sampleData1(dataManager); Command command = helpParse(sql); ProcessorPlan plan = helpGetPlan(command, RealMetadataFactory.example1Cached(), TestOptimizer.getGenericFinder(false)); // Run query helpProcess(plan, dataManager, expected); } [2] Results: ['x1', 'x2', 'x3'] 0: [x1, x2, null] 1: [x1, x2, null] 2: [x1, x2, null] 3: [x1, x2, null] 4: [x1, x2, null] 5: [x1, x2, null]

      The test framework is returning nulls for literals specified in a query.

            rhn-engineering-shawkins Steven Hawkins
            rhn-support-jolee Johnathon Lee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: