Skip to content

Use derived parser to parse integration tests schedule file rather than maintaining manual parsing code. #1952

@liurenjie1024

Description

@liurenjie1024

Is your feature request related to a problem or challenge?

Currently in integration tests, we parse schedule definition using manually written code, see

async fn parse_engines(

async fn create_catalog(config: &TomlTable) -> Result<Arc<dyn Catalog>> {

There are many problems with this approach:

  1. Difficult to read and maintain.
  2. It mixes parsing and generation of catalog, engine runner.

We should separate the process of parsing and engine/catalog creation so that it would easier to test the parsing code.

Describe the solution you'd like

We should add some struct like following:

#[derive(Serialize, Deserialize)]
pub struct ScheduleDef {
   engines: HashMap<String, EngineDef>,
   steps: Vec<StepDef>
}

#[derive(Serialize, Deserialize)]
pub struct StepDef {
  engine_name: String,
  slt_file: String
}

#[derive(Serialize, Deserialize)]
pub enum EngineDef {
   Dafafusion { 
     ....
   }
}

#[derive(Serialize, Deserialize)]
pub struct DatafusionCatalogDef {
   ....  
}

And then we could parse them using generated code.

Willingness to contribute

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions