Skip to content

Conversation

kerwin-zk
Copy link
Contributor

Purpose

Optimize exception message in checkNamespace method

Tests

CI

public class CatalogUtils {

public static void checkNamespace(String[] namespace) {
public static void checkNamespace(String[] namespace, String catalogName) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try spark.sessionState.catalogManager.currentCatalog.name to get catalog name

checkArgument(
namespace.length == 1,
"Paimon only support single namespace, but got %s",
"Current catalog is %s, catalog %s does not exist or Paimon only support single namespace, but got %s",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test case for this

@kerwin-zk kerwin-zk force-pushed the fix-exception-message branch from 02e7d4a to de733b7 Compare October 13, 2025 03:41

public static void checkNamespace(String[] namespace) {
String catalogName =
SparkSession.getActiveSession()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use PaimonSparkSession.active

@kerwin-zk kerwin-zk force-pushed the fix-exception-message branch 2 times, most recently from 010f2df to 92635a3 Compare October 13, 2025 08:21
@kerwin-zk kerwin-zk force-pushed the fix-exception-message branch from 92635a3 to 9943048 Compare October 13, 2025 08:44
Copy link
Contributor

@Zouxxyy Zouxxyy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@Zouxxyy Zouxxyy merged commit 845bdd5 into apache:master Oct 14, 2025
19 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants