[improvement](jdbc catalog) remove useless jdbc catalog code (#34986) (#35418)

This commit is contained in:
zy-kkk
2024-05-27 14:25:26 +08:00
committed by GitHub
parent e3b4d4e630
commit 2e20e38523
16 changed files with 154 additions and 1639 deletions

View File

@ -24,9 +24,6 @@ import org.apache.doris.catalog.Type;
import org.apache.doris.common.Pair;
import org.apache.doris.common.exception.InternalException;
import com.vesoft.nebula.client.graph.data.DateTimeWrapper;
import com.vesoft.nebula.client.graph.data.DateWrapper;
import com.vesoft.nebula.client.graph.data.ValueWrapper;
import org.apache.log4j.Logger;
import sun.misc.Unsafe;
@ -38,8 +35,6 @@ import java.net.URL;
import java.net.URLClassLoader;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Set;
public class UdfUtils {
@ -231,56 +226,4 @@ public class UdfUtils {
}
return bytes;
}
// only used by nebula-graph
// transfer to an object that can copy to the block
public static Object convertObject(ValueWrapper value) {
try {
if (value.isLong()) {
return value.asLong();
}
if (value.isBoolean()) {
return value.asBoolean();
}
if (value.isDouble()) {
return value.asDouble();
}
if (value.isString()) {
return value.asString();
}
if (value.isTime()) {
return value.asTime().toString();
}
if (value.isDate()) {
DateWrapper date = value.asDate();
return LocalDate.of(date.getYear(), date.getMonth(), date.getDay());
}
if (value.isDateTime()) {
DateTimeWrapper dateTime = value.asDateTime();
return LocalDateTime.of(dateTime.getYear(), dateTime.getMonth(), dateTime.getDay(),
dateTime.getHour(), dateTime.getMinute(), dateTime.getSecond(), dateTime.getMicrosec() * 1000);
}
if (value.isVertex()) {
return value.asNode().toString();
}
if (value.isEdge()) {
return value.asRelationship().toString();
}
if (value.isPath()) {
return value.asPath().toString();
}
if (value.isList()) {
return value.asList().toString();
}
if (value.isSet()) {
return value.asSet().toString();
}
if (value.isMap()) {
return value.asMap().toString();
}
return null;
} catch (Exception e) {
return null;
}
}
}