Skip to content

Commit bc26684

Browse files
committed
fix failures tests
1 parent 84cdf2f commit bc26684

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/sink/PaimonSinkWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public PaimonSinkWriter(
176176
log.warn("Append only table currently do not support dynamic bucket");
177177
}
178178
if (dynamicBucket) {
179-
paimonBucketAssignerFactory.init(paimonTablePath, paimonTable, parallelism);
179+
paimonBucketAssignerFactory.init(paimonTablePath, paimonFileStoretable, parallelism);
180180
}
181181
PaimonSecurityContext.shouldEnableKerberos(paimonHadoopConfiguration);
182182
}

seatunnel-connectors-v2/connector-paimon/src/test/java/org/apache/seatunnel/connectors/seatunnel/paimon/catalog/PaimonPrivilegeCatalogTest.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
public class PaimonPrivilegeCatalogTest {
106106

107107
private PaimonCatalog authorizedCatalog;
108+
private PaimonCatalog authorizedSelectCatalog;
108109
private PaimonCatalog unAuthorizedCatalog;
109110
private PaimonCatalog rootUserPaimonCatalog;
110111
private String CATALOG_NAME = "paimon_catalog";
@@ -117,9 +118,11 @@ public class PaimonPrivilegeCatalogTest {
117118
private String rootPassword = "123456";
118119
private String bucketKey = "f0";
119120
private String authorizeUser = "paimon";
121+
private String authorizeSelectUser = "authorize_select_user";
120122
private String authorizeUserPassword = "123456";
121123
private String unAuthorizeUser = "unauthorized_paimon";
122124
private String unAuthorizeUserPassword = "123456";
125+
private String authorizeSelectUserPassword = "123456";
123126

124127
private int writeRows = 0;
125128

@@ -129,6 +132,8 @@ public void before() {
129132
initPrivilege();
130133
rootUserPaimonCatalog = createPaimonCatalog(rootUser, rootPassword);
131134
authorizedCatalog = createPaimonCatalog(authorizeUser, authorizeUserPassword);
135+
authorizedSelectCatalog =
136+
createPaimonCatalog(authorizeSelectUser, authorizeSelectUserPassword);
132137
unAuthorizedCatalog = createPaimonCatalog(unAuthorizeUser, unAuthorizeUserPassword);
133138

134139
createUser(authorizeUser, authorizeUserPassword);
@@ -141,6 +146,12 @@ public void before() {
141146
PrivilegeType.INSERT
142147
});
143148
createUser(unAuthorizeUser, unAuthorizeUserPassword);
149+
createUser(authorizeSelectUser, authorizeSelectUserPassword);
150+
grantPrivilege(
151+
authorizeSelectUser,
152+
new PrivilegeType[] {
153+
PrivilegeType.SELECT,
154+
});
144155

145156
createDatabase();
146157
catalogTable = buildTable(TABLE_NAME);
@@ -348,14 +359,14 @@ public void testWriteTable() throws IOException {
348359
NoPrivilegeException.class,
349360
() -> {
350361
try {
351-
writeTable(unAuthorizedCatalog, rows);
362+
writeTable(authorizedSelectCatalog, rows);
352363
} catch (NoPrivilegeException e) {
353364
assertTrue(
354365
e.getMessage()
355366
.contains(
356367
String.format(
357368
"User %s doesn't have privilege INSERT on table",
358-
unAuthorizeUser)));
369+
authorizeSelectUser)));
359370
throw e;
360371
}
361372
});

0 commit comments

Comments
 (0)