pub fn lower_to_ir(
    root_mod: RootModule,
    main_path: &[String],
    database_module_path: &[String]
) -> Result<(RelationalQuery, RootModule), Error>
Expand description

Convert a resolved expression at path main_path relative to root_mod into RQ and make sure that:

  • transforms are not nested,
  • transforms have correct partition, window and sort set,
  • make sure there are no unresolved expressions.

All table references must reside within module at database_module_path. They are compiled to table identifiers, using their path relative to the database module. For example, with database_module_path=my_database:

  • my_database.my_table will compile to "my_table",
  • my_database.my_schema.my_table will compile to "my_schema.my_table",
  • my_table will error out saying that this table does not reside in current database.