@Test
public void qualified_name_with_qualifier() {

  analysisContext.push();
  analysisContext.peek().define(new Symbol(Namespace.INDEX_NAME, "index_alias"), STRUCT);
  assertAnalyzeEqual(
      DSL.ref("integer_value", INTEGER),
      AstDSL.qualifiedName("index_alias", "integer_value")
  );
  analysisContext.peek().define(new Symbol(Namespace.FIELD_NAME, "nested_field"), STRUCT);
  SyntaxCheckException exception =
      assertThrows(SyntaxCheckException.class,
          () -> analyze(AstDSL.qualifiedName("nested_field", "integer_value")));
  assertEquals(
      "The qualifier [nested_field] of qualified name [nested_field.integer_value] "
          + "must be an index name or its alias",
      exception.getMessage()
  );
  analysisContext.pop();
}