Csc 1302, Honors Principles of Computer Science II (Fall 2021)

Week 12 (12 November 2021)

semanticCheckAndSetSchemaAndDataTypes in Expression Tree

During this week you will complete the sections related to "times" and "join" in the following method from RANode.java:
  public String semanticCheckAndSetSchemaAndDataTypes(Database db) {
    // This method checks for Semantic Errors and returns an error message
    // if there is a semantic error. If there are no semantic errors then this method
    // sets the following 3 instance variables for RANode class:
    // public ArrayList<String> joinColumns; // set this only for join
    // public ArrayList<String> schemaColumns;
    // public ArrayList<String> schemaDataTypes;
    // and returns "OK"

    if(rnodetype.equals("relation")){
     
    }
    else if(rnodetype.equals("union") ||
            rnodetype.equals("minus") ||
            rnodetype.equals("intersect")){

    }
    else if(rnodetype.equals("times")){
      // week 12
      // SEMANTIC ERROR CHECKS: None

    }
    else if(rnodetype.equals("join")){
      // week 12
      // SEMANTIC ERROR CHECKS: None

    }
    else if(rnodetype.equals("rename")){
      return "OK";
    }
    else if(rnodetype.equals("project")){
      return "OK";
    }
    else if(rnodetype.equals("select")){
      return "OK";
    }
    else {
      return "SOMETHING STRANGE TOOK PLACE!";
    }
  }