Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report] couldn't get schema comment from mysql catalog #1717

Closed
FANNG1 opened this issue Jan 25, 2024 · 2 comments · Fixed by #1784
Closed

[Bug report] couldn't get schema comment from mysql catalog #1717

FANNG1 opened this issue Jan 25, 2024 · 2 comments · Fixed by #1784
Assignees
Labels
bug Something isn't working

Comments

@FANNG1
Copy link
Contributor

FANNG1 commented Jan 25, 2024

Version

main branch

Describe what's wrong

couldn't get schema comment from mysql catalog

Error message and/or stacktrace

org.opentest4j.AssertionFailedError: expected: <comment> but was: <null>
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
	at org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1141)
	at com.datastrato.gravitino.integration.test.catalog.jdbc.mysql.CatalogMysqlIT.testCreateAndLoadSchema(CatalogMysqlIT.java:579)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)

How to reproduce

  @Test
  void testCreateAndLoadSchema() {
    String testSchemaName = "test";
    NameIdentifier ident = NameIdentifier.of(metalakeName, catalogName, testSchemaName);

    Schema schema = catalog.asSchemas().createSchema(ident, "comment", null);
    Assertions.assertEquals("anonymous", schema.auditInfo().creator());
    Assertions.assertEquals("comment", schema.comment());
    schema = catalog.asSchemas().loadSchema(ident);
    Assertions.assertEquals("anonymous", schema.auditInfo().creator());
    Assertions.assertEquals("comment", schema.comment());
}

Additional context

No response

@FANNG1 FANNG1 added the bug Something isn't working label Jan 25, 2024
@FANNG1 FANNG1 self-assigned this Jan 25, 2024
@jerryshao jerryshao added this to the Gravitino 0.4.0 milestone Jan 26, 2024
@FANNG1
Copy link
Contributor Author

FANNG1 commented Jan 26, 2024

Mysql doesn't support set comment on databases, cc @jerryshao @Clearvive .

@FANNG1
Copy link
Contributor Author

FANNG1 commented Jan 29, 2024

I suggest to add a check on comment, if user set MySQL schema comment, throw a exception instead of print a log and eat it. @jerryshao @Clearvive what do you think?

jerryshao pushed a commit that referenced this issue Jan 30, 2024
…QL database (#1784)

### What changes were proposed in this pull request?
throw a exception when user. set comment on MySQL database

### Why are the changes needed?

Fix: #1717 #1767 

### Does this PR introduce _any_ user-facing change?
yes, if user  set comment on MySQL database, will throw a exception.

### How was this patch tested?
add UT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants