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

False infos displayed: #257

Open
throuch opened this issue May 15, 2024 · 0 comments
Open

False infos displayed: #257

throuch opened this issue May 15, 2024 · 0 comments

Comments

@throuch
Copy link

throuch commented May 15, 2024

Hello,

when schemaCheckEnabled is set to false we get confusing messages like this one (not exhaustive):

24/05/13 09:51:01 INFO BulkCopyUtils: Spark Dataframe and SQL Server table have differing column nullable configurations at column index 14 DF col XXX nullable config is true Table col XXX nullable config is true

in the class BulkCopyUtils, we have this implementation:

private def assertIfCheckEnabled(
            cond: Boolean, checkEnabled : Boolean,  msg: String): Unit = {
        if(checkEnabled) {
            assertCondition(cond, msg)
        }
        else{
           logInfo(msg)
        }
    }

It's wrong as it displays misleading messages (saying there are differences) when the condition is true. So I suggest this patch:

private def assertIfCheckEnabled(
            cond: Boolean, checkEnabled : Boolean,  msg: String): Unit = {
        if(checkEnabled) {
            assertCondition(cond, msg)
        }
        else if (!cond) {
           logWarn(msg)
        }
    }
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

No branches or pull requests

1 participant