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

Dependent View with External Materialization load problems

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 9.2
    • 9.1.2
    • Common
    • None
    • Hide
      1. Create in MySQL the ddl (import ddl.sql file)
      2. Create the required datasources and resource adaptors
      3. Import the given VDBs
      4. Wait for the system to deploy them
      5. Consult status table (FAILED_LOAD) or query my_view directly (error with no such group exists)
      Show
      Create in MySQL the ddl (import ddl.sql file) Create the required datasources and resource adaptors Import the given VDBs Wait for the system to deploy them Consult status table (FAILED_LOAD) or query my_view directly (error with no such group exists)

      Having defined two views with external materialization, and second view (my_view) uses the first view (numbering_plan).

      Second view (my_view) definition

      CREATE VIEW my_view(
      ...
      )
      OPTIONS(

      MATERIALIZED 'TRUE',
      MATERIALIZED_TABLE 'MyMaterialized.my_view_cache',
      ....
      )
      AS
      SELECT cns,
      country_code
      FROM NumberingPlan2.numbering_plan;

      When my_view is loaded for the first time the following error appears:

      First Warning

      14:41:13,693 WARN [org.teiid.MATVIEWS] (Worker1_QueryProcessorQueue27) 7qmYa3eWflIY org.teiid.jdbc.TeiidSQLException: TEIID30328 Unable to evaluate (SELECT mvstatus('NumberingPlan2', 'numbering_plan', Valid, LoadState, 'THROW_EXCEPTION') FROM (SELECT 1) AS x LEFT OUTER JOIN NumberingPlanMaterialized2.status ON SchemaName = 'NumberingPlan2' AND Name = 'numbering_plan' LIMIT 2): TEIID30328 Unable to evaluate mvstatus('NumberingPlan2', 'numbering_plan', Valid, LoadState, 'THROW_EXCEPTION'): TEIID30384 Error while evaluating function mvstatus

      If my_view _is queried in the meantime something like this appears in logs (and in the client who tried to perform the query against _my_view):

      Invoking my_view error

      14:49:04,493 WARN [org.teiid.PROCESSOR] (Worker7_QueryProcessorQueue10979) 57KCZOf/UjCV TEIID30020 Processing exception for request 57KCZOf/UjCV.0 'Group does not exist: my_view'. Originally QueryResolverException ResolverUtil.java:880. Enable more detailed logging to see the entire stacktrace.

      We have to wait until my_view MATVIEW_TTL 'expires' in order for the view to be loaded and start to have results being returned. Of course we can call *loadMatView *explicitly, but the system could be wise enough to know that has one view that is dependent of another and that the materialization must occur first, so it should have waited in the background for the numbering_plan _materialization to occur and then trigger the materialization of _my_view afterwards (or if the materialization is not available then at least consult the 'original' data instead).

        1. ddl.sql
          2 kB
          Pedro Inácio
        2. externalMaterializationOrderProblem-vdb.xml
          2 kB
          Pedro Inácio
        3. numberingPlan-vdb.xml
          4 kB
          Pedro Inácio

              rhn-engineering-shawkins Steven Hawkins
              pringi Pedro Inácio (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: