starocean999 commented on code in PR #47554: URL: https://github.com/apache/doris/pull/47554#discussion_r2036690143
########## fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java: ########## @@ -6468,5 +6473,115 @@ public LogicalPlan visitKillAnalyzeJob(DorisParser.KillAnalyzeJobContext ctx) { long jobId = Long.parseLong(ctx.jobId.getText()); return new KillAnalyzeJobCommand(jobId); } + + /** + * PasswordOption + */ + public PasswordOptions visitPasswordOption(DorisParser.PasswordOptionContext ctx) { + int historyPolicy = -2; + long expirePolicySecond = -2; + int reusePolicy = -2; + int loginAttempts = -2; + long passwordLockSecond = -2; + int accountUnlocked = -2; + + if (ctx.historyDefault != null) { + historyPolicy = -1; + } else if (ctx.historyValue != null) { + historyPolicy = Integer.parseInt(ctx.historyValue.getText()); + } + + if (ctx.expireDefault != null) { + expirePolicySecond = -1; + } else if (ctx.expireNever != null) { + expirePolicySecond = 0; + } else if (ctx.expireValue != null) { + long value = Long.parseLong(ctx.expireValue.getText()); + expirePolicySecond = getSecond(value, ctx.expireTimeUnit.getText()); + } + + if (ctx.reuseValue != null) { + reusePolicy = Integer.parseInt(ctx.reuseValue.getText()); + } + + if (ctx.attemptsValue != null) { + loginAttempts = Integer.parseInt(ctx.attemptsValue.getText()); + } + + if (ctx.lockUnbounded != null) { + passwordLockSecond = -1; + } else if (ctx.lockValue != null) { + long value = Long.parseLong(ctx.lockValue.getText()); + passwordLockSecond = getSecond(value, ctx.lockTimeUint.getText()); + } + + if (ctx.ACCOUNT_LOCK() != null) { + accountUnlocked = -1; + } else if (ctx.ACCOUNT_UNLOCK() != null) { + accountUnlocked = 1; + } + + if (expirePolicySecond == -2 && historyPolicy == -2 && reusePolicy == -2 + && loginAttempts == -2 && passwordLockSecond == -2 && accountUnlocked == -2) { + return PasswordOptions.UNSET_OPTION; Review Comment: ```suggestion ``` looks like PasswordOptions.UNSET_OPTION is actually all options are PasswordOptions.UNSET. So we can just remove this if(){...} block -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org