linkedin / linkedin/coral

Coral-Schema alias output upper-cased schema even if I explicitly alias to lower case

Open
#249 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
906
Forks
219
Avg merge
2d 13h
Merged PRs (30d)
2

Description

To reproduce this issue:

add this test in ViewToAvroSchemaConverterTests and run it:

  @Test
  public void foo() {
    String viewSql = "CREATE VIEW v AS SELECT id as id FROM basecomplex";
    TestUtils.executeCreateViewQuery("default", "v", viewSql);

    ViewToAvroSchemaConverter viewToAvroSchemaConverter = ViewToAvroSchemaConverter.create(hiveMetastoreClient);
    Schema actualSchema = viewToAvroSchemaConverter.toAvroSchema("default", "v", false, false);

    System.out.println(actualSchema);
  }

the output will be:

{"type":"record","name":"v","namespace":"default.v","fields":[{"name":"Id","type":"int"}]}

Which shows the column name is Id rather than the explicit lower-cased alias: id.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Add the reproducer to ViewToAvroSchemaConverterTests and run it to observe the generated schema. Start at ViewToAvroSchemaConverter.toAvroSchema, then compare the output field name with the explicit id alias. Done means the generated schema preserves the lower-case alias.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.