Skip to content

Commit

Permalink
revert unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gnehil committed Aug 9, 2024
1 parent 5001070 commit 3cccad0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static BulkLoadJob fromLoadStmt(LoadStmt stmt) throws DdlException {
case DELETE:
case HADOOP:
case INSERT:
throw new DdlException("LoadManager only support create broker load job from stmt.");
throw new DdlException("LoadManager only support create broker load job and spark from stmt.");
default:
throw new DdlException("Unknown load job type.");
}
Expand Down Expand Up @@ -410,6 +410,11 @@ public static BulkLoadJob fromInsertStmt(InsertStmt insertStmt) throws DdlExcept
insertStmt.getLoadLabel().getLabelName(), (BrokerDesc) insertStmt.getResourceDesc(),
insertStmt.getOrigStmt(), insertStmt.getUserInfo());
break;
case SPARK_LOAD:
bulkLoadJob = new SparkLoadJob(db.getId(), insertStmt.getLoadLabel().getLabelName(),
insertStmt.getResourceDesc(),
insertStmt.getOrigStmt(), insertStmt.getUserInfo());
break;
default:
throw new DdlException("Unknown load job type.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public class GsonUtils {
.registerSubtype(PaimonFileExternalCatalog.class, PaimonFileExternalCatalog.class.getSimpleName())
.registerSubtype(MaxComputeExternalCatalog.class, MaxComputeExternalCatalog.class.getSimpleName())
.registerSubtype(
TrinoConnectorExternalCatalog.class, TrinoConnectorExternalCatalog.class.getSimpleName())
TrinoConnectorExternalCatalog.class, TrinoConnectorExternalCatalog.class.getSimpleName())
.registerSubtype(LakeSoulExternalCatalog.class, LakeSoulExternalCatalog.class.getSimpleName())
.registerSubtype(TestExternalCatalog.class, TestExternalCatalog.class.getSimpleName());
if (Config.isNotCloudMode()) {
Expand All @@ -430,9 +430,9 @@ public class GsonUtils {
.registerSubtype(KafkaDataSourceProperties.class, KafkaDataSourceProperties.class.getSimpleName());
private static RuntimeTypeAdapterFactory<org.apache.doris.job.base.AbstractJob>
jobExecutorRuntimeTypeAdapterFactory
= RuntimeTypeAdapterFactory.of(org.apache.doris.job.base.AbstractJob.class, "clazz")
.registerSubtype(InsertJob.class, InsertJob.class.getSimpleName())
.registerSubtype(MTMVJob.class, MTMVJob.class.getSimpleName());
= RuntimeTypeAdapterFactory.of(org.apache.doris.job.base.AbstractJob.class, "clazz")
.registerSubtype(InsertJob.class, InsertJob.class.getSimpleName())
.registerSubtype(MTMVJob.class, MTMVJob.class.getSimpleName());

private static RuntimeTypeAdapterFactory<MTMVSnapshotIf> mtmvSnapshotTypeAdapterFactory =
RuntimeTypeAdapterFactory.of(MTMVSnapshotIf.class, "clazz")
Expand Down Expand Up @@ -562,25 +562,25 @@ public class GsonUtils {

private static RuntimeTypeAdapterFactory<org.apache.doris.backup.AbstractJob>
jobBackupTypeAdapterFactory
= RuntimeTypeAdapterFactory.of(org.apache.doris.backup.AbstractJob.class, "clazz")
.registerSubtype(BackupJob.class, BackupJob.class.getSimpleName())
.registerSubtype(RestoreJob.class, RestoreJob.class.getSimpleName());
= RuntimeTypeAdapterFactory.of(org.apache.doris.backup.AbstractJob.class, "clazz")
.registerSubtype(BackupJob.class, BackupJob.class.getSimpleName())
.registerSubtype(RestoreJob.class, RestoreJob.class.getSimpleName());

private static RuntimeTypeAdapterFactory<LoadJob> loadJobTypeAdapterFactory
= RuntimeTypeAdapterFactory.of(LoadJob.class, "clazz")
.registerSubtype(BrokerLoadJob.class, BrokerLoadJob.class.getSimpleName())
.registerSubtype(BulkLoadJob.class, BulkLoadJob.class.getSimpleName())
.registerSubtype(CloudBrokerLoadJob.class, CloudBrokerLoadJob.class.getSimpleName())
.registerSubtype(CopyJob.class, CopyJob.class.getSimpleName())
.registerSubtype(InsertLoadJob.class, InsertLoadJob.class.getSimpleName())
.registerSubtype(MiniLoadJob.class, MiniLoadJob.class.getSimpleName())
.registerSubtype(SparkLoadJob.class, SparkLoadJob.class.getSimpleName())
.registerSubtype(IngestionLoadJob.class, IngestionLoadJob.class.getSimpleName());
= RuntimeTypeAdapterFactory.of(LoadJob.class, "clazz")
.registerSubtype(BrokerLoadJob.class, BrokerLoadJob.class.getSimpleName())
.registerSubtype(BulkLoadJob.class, BulkLoadJob.class.getSimpleName())
.registerSubtype(CloudBrokerLoadJob.class, CloudBrokerLoadJob.class.getSimpleName())
.registerSubtype(CopyJob.class, CopyJob.class.getSimpleName())
.registerSubtype(InsertLoadJob.class, InsertLoadJob.class.getSimpleName())
.registerSubtype(MiniLoadJob.class, MiniLoadJob.class.getSimpleName())
.registerSubtype(SparkLoadJob.class, SparkLoadJob.class.getSimpleName())
.registerSubtype(IngestionLoadJob.class, IngestionLoadJob.class.getSimpleName());

private static RuntimeTypeAdapterFactory<PartitionItem> partitionItemTypeAdapterFactory
= RuntimeTypeAdapterFactory.of(PartitionItem.class, "clazz")
.registerSubtype(ListPartitionItem.class, ListPartitionItem.class.getSimpleName())
.registerSubtype(RangePartitionItem.class, RangePartitionItem.class.getSimpleName());
= RuntimeTypeAdapterFactory.of(PartitionItem.class, "clazz")
.registerSubtype(ListPartitionItem.class, ListPartitionItem.class.getSimpleName())
.registerSubtype(RangePartitionItem.class, RangePartitionItem.class.getSimpleName());

// the builder of GSON instance.
// Add any other adapters if necessary.
Expand Down Expand Up @@ -893,7 +893,7 @@ private static class AtomicBooleanAdapter

@Override
public AtomicBoolean deserialize(JsonElement jsonElement, Type type,
JsonDeserializationContext jsonDeserializationContext)
JsonDeserializationContext jsonDeserializationContext)
throws JsonParseException {
JsonObject jsonObject = jsonElement.getAsJsonObject();
boolean value = jsonObject.get("boolean").getAsBoolean();
Expand All @@ -902,7 +902,7 @@ public AtomicBoolean deserialize(JsonElement jsonElement, Type type,

@Override
public JsonElement serialize(AtomicBoolean atomicBoolean, Type type,
JsonSerializationContext jsonSerializationContext) {
JsonSerializationContext jsonSerializationContext) {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("boolean", atomicBoolean.get());
return jsonObject;
Expand All @@ -912,7 +912,7 @@ public JsonElement serialize(AtomicBoolean atomicBoolean, Type type,
public static final class ImmutableMapDeserializer implements JsonDeserializer<ImmutableMap<?, ?>> {
@Override
public ImmutableMap<?, ?> deserialize(final JsonElement json, final Type type,
final JsonDeserializationContext context) throws JsonParseException {
final JsonDeserializationContext context) throws JsonParseException {
final Type type2 = TypeUtils.parameterize(Map.class, ((ParameterizedType) type).getActualTypeArguments());
final Map<?, ?> map = context.deserialize(json, type2);
return ImmutableMap.copyOf(map);
Expand All @@ -922,7 +922,7 @@ public static final class ImmutableMapDeserializer implements JsonDeserializer<I
public static final class ImmutableListDeserializer implements JsonDeserializer<ImmutableList<?>> {
@Override
public ImmutableList<?> deserialize(final JsonElement json, final Type type,
final JsonDeserializationContext context) throws JsonParseException {
final JsonDeserializationContext context) throws JsonParseException {
final Type type2 = TypeUtils.parameterize(List.class, ((ParameterizedType) type).getActualTypeArguments());
final List<?> list = context.deserialize(json, type2);
return ImmutableList.copyOf(list);
Expand Down

0 comments on commit 3cccad0

Please sign in to comment.