Skip to content

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
zclllyybb committed Dec 25, 2024
1 parent 360a40e commit 2d10132
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 18 deletions.
6 changes: 0 additions & 6 deletions fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
Original file line number Diff line number Diff line change
Expand Up @@ -3383,12 +3383,6 @@ public void createTableAsSelect(CreateTableAsSelectStmt stmt) throws DdlExceptio
getInternalCatalog().createTableAsSelect(stmt);
}

/**
* Create Dictionary table
*
* @param stmt
*/

/**
* Adds a partition to a table
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void unlockWrite() {

/**
* Create a new dictionary based on the provided info.
*
*
* @throws DdlException if the dictionary already exists and ifNotExists is false
*/
public Dictionary createDictionary(CreateDictionaryInfo info) throws DdlException {
Expand Down Expand Up @@ -123,7 +123,7 @@ public Dictionary createDictionary(CreateDictionaryInfo info) throws DdlExceptio

/**
* Delete a dictionary.
*
*
* @throws DdlException if the dictionary does not exist
*/
public void dropDictionary(String dbName, String dictName, boolean ifExists) throws DdlException {
Expand Down Expand Up @@ -191,7 +191,7 @@ public Map<String, Dictionary> getDictionaries(String dbName) {

/**
* Get a dictionary.
*
*
* @throws DdlException if the dictionary does not exist
*/
public Dictionary getDictionary(String dbName, String dictName) throws DdlException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
import org.apache.doris.nereids.DorisParser.DeleteContext;
import org.apache.doris.nereids.DorisParser.DereferenceContext;
import org.apache.doris.nereids.DorisParser.DictionaryColumnDefContext;
import org.apache.doris.nereids.DorisParser.DictionaryColumnDefsContext;
import org.apache.doris.nereids.DorisParser.DropCatalogContext;
import org.apache.doris.nereids.DorisParser.DropCatalogRecycleBinContext;
import org.apache.doris.nereids.DorisParser.DropConstraintContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.doris.nereids.trees.plans.commands;

import org.apache.doris.analysis.StmtType;
import org.apache.doris.catalog.Env;
import org.apache.doris.dictionary.Dictionary;
import org.apache.doris.nereids.exceptions.AnalysisException;
import org.apache.doris.nereids.trees.plans.PlanType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ public class CreateDictionaryInfo {

private final Map<String, String> properties;

/**
* Constructor.
*
* @param ifNotExists if not exists
* @param dbName database name
* @param dictName dictionary name
* @param sourceCtlName source catalog name
* @param sourceDbName source database name
* @param sourceTableName source table name
* @param columns dictionary columns
* @param properties dictionary properties
*/
public CreateDictionaryInfo(boolean ifNotExists, String dbName, String dictName, String sourceCtlName,
String sourceDbName, String sourceTableName, List<DictionaryColumnDefinition> columns,
Map<String, String> properties) {
Expand All @@ -75,6 +87,11 @@ public CreateDictionaryInfo(boolean ifNotExists, String dbName, String dictName,
this.properties = Objects.requireNonNull(properties, "Properties cannot be null");
}

/**
* Get dictionary name parts.
*
* @return list of dictionary name parts
*/
public List<String> getDictionaryNameParts() {
List<String> parts = Lists.newArrayList();
if (!Strings.isNullOrEmpty(dbName)) {
Expand All @@ -84,6 +101,11 @@ public List<String> getDictionaryNameParts() {
return parts;
}

/**
* Get source table name parts.
*
* @return list of source table name parts
*/
public List<String> getSourceTableNameParts() {
List<String> parts = Lists.newArrayList();
if (!Strings.isNullOrEmpty(sourceCtlName)) {
Expand All @@ -98,8 +120,8 @@ public List<String> getSourceTableNameParts() {

/**
* Validate create dictionary info. about dictionary name, source table legal.
*
* @throws DdlException
*
* @throws DdlException if not found db
*/
public void validate(ConnectContext ctx) throws org.apache.doris.common.AnalysisException, DdlException {
// Check dictionary name format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

package org.apache.doris.nereids.trees.plans.commands.info;

import java.util.Objects;

import org.apache.doris.catalog.Type;

import java.util.Objects;

/**
* Definition of a dictionary column.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ public static MetaPersistMethod create(String name) throws NoSuchMethodException
CountingDataOutputStream.class, long.class);
break;
case "dictionaryManager":
metaPersistMethod.readMethod = Env.class.getDeclaredMethod("loadDictionaryManager", DataInputStream.class,
long.class);
metaPersistMethod.readMethod = Env.class.getDeclaredMethod("loadDictionaryManager",
DataInputStream.class, long.class);
metaPersistMethod.writeMethod = Env.class.getDeclaredMethod("saveDictionaryManager",
CountingDataOutputStream.class, long.class);
CountingDataOutputStream.class, long.class);
break;
default:
break;
Expand Down

0 comments on commit 2d10132

Please sign in to comment.