Skip to content

Commit 2d8f7f8

Browse files
committed
format
Committed-by: bingqing.lbq from Dev container
1 parent 98d01a1 commit 2d8f7f8

File tree

2 files changed

+48
-36
lines changed

2 files changed

+48
-36
lines changed

interactive_engine/common/src/main/java/com/alibaba/graphscope/groot/common/schema/wrapper/PropertyValue.java

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -74,42 +74,50 @@ private static Object stringToObj(DataType dataType, Object val) {
7474
case STRING:
7575
return valString;
7676
case DATE:
77-
{
78-
try {
79-
return Integer.valueOf(valString);
80-
} catch (Exception e) {
81-
try {
82-
LocalDate date = LocalDate.parse(valString, DateTimeFormatter.ISO_LOCAL_DATE);
83-
long epochDays = date.toEpochDay();
84-
return Integer.valueOf((int) epochDays);
85-
} catch (Exception e1) {
86-
throw new InvalidArgumentException("unable to parse date string to date. DataType ["
87-
+ dataType
88-
+ "], Object ["
89-
+ valString
90-
+ "], class ["
91-
+ valString.getClass()
92-
+ "]", e1);
93-
}
77+
{
78+
try {
79+
return Integer.valueOf(valString);
80+
} catch (Exception e) {
81+
try {
82+
LocalDate date =
83+
LocalDate.parse(
84+
valString, DateTimeFormatter.ISO_LOCAL_DATE);
85+
long epochDays = date.toEpochDay();
86+
return Integer.valueOf((int) epochDays);
87+
} catch (Exception e1) {
88+
throw new InvalidArgumentException(
89+
"unable to parse date string to date. DataType ["
90+
+ dataType
91+
+ "], Object ["
92+
+ valString
93+
+ "], class ["
94+
+ valString.getClass()
95+
+ "]",
96+
e1);
97+
}
98+
}
9499
}
95-
}
96100
case TIME32:
97101
{
98102
try {
99103
return Integer.valueOf(valString);
100104
} catch (Exception e) {
101105
try {
102-
LocalTime time = LocalTime.parse(valString, DateTimeFormatter.ISO_LOCAL_TIME);
106+
LocalTime time =
107+
LocalTime.parse(
108+
valString, DateTimeFormatter.ISO_LOCAL_TIME);
103109
int seconds = time.toSecondOfDay();
104110
return Integer.valueOf(seconds);
105111
} catch (Exception e1) {
106-
throw new InvalidArgumentException("unable to parse time32 string to int. DataType ["
107-
+ dataType
108-
+ "], Object ["
109-
+ valString
110-
+ "], class ["
111-
+ valString.getClass()
112-
+ "]", e1);
112+
throw new InvalidArgumentException(
113+
"unable to parse time32 string to int. DataType ["
114+
+ dataType
115+
+ "], Object ["
116+
+ valString
117+
+ "], class ["
118+
+ valString.getClass()
119+
+ "]",
120+
e1);
113121
}
114122
}
115123
}
@@ -119,17 +127,21 @@ private static Object stringToObj(DataType dataType, Object val) {
119127
return Long.valueOf(valString);
120128
} catch (Exception e) {
121129
try {
122-
LocalDateTime dateTime = LocalDateTime.parse(valString, DateTimeFormatter.ISO_DATE_TIME);
130+
LocalDateTime dateTime =
131+
LocalDateTime.parse(
132+
valString, DateTimeFormatter.ISO_DATE_TIME);
123133
long millis = dateTime.toEpochSecond(ZoneOffset.UTC) * 1000;
124134
return Long.valueOf(millis);
125135
} catch (Exception e1) {
126-
throw new InvalidArgumentException("unable to parse timestamp string to long. DataType ["
127-
+ dataType
128-
+ "], Object ["
129-
+ valString
130-
+ "], class ["
131-
+ valString.getClass()
132-
+ "]", e1);
136+
throw new InvalidArgumentException(
137+
"unable to parse timestamp string to long. DataType ["
138+
+ dataType
139+
+ "], Object ["
140+
+ valString
141+
+ "], class ["
142+
+ valString.getClass()
143+
+ "]",
144+
e1);
133145
}
134146
}
135147
}

interactive_engine/compiler/src/main/java/com/alibaba/graphscope/common/ir/meta/schema/IrDataTypeConvertor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ public RelDataType convert(DataType from) {
8080
case UINT:
8181
// 4-bytes unsigned integer
8282
return typeFactory.createSqlType(
83-
SqlTypeName.DECIMAL, UINT32_PRECISION, UINT32_SCALE);
83+
SqlTypeName.DECIMAL, UINT32_PRECISION, UINT32_SCALE);
8484
case LONG:
8585
// 8-bytes signed integer
8686
return typeFactory.createSqlType(SqlTypeName.BIGINT);
8787
case ULONG:
8888
// 8-bytes unsigned integer
8989
return typeFactory.createSqlType(
90-
SqlTypeName.DECIMAL, UINT64_PRECISION, UINT64_SCALE);
90+
SqlTypeName.DECIMAL, UINT64_PRECISION, UINT64_SCALE);
9191
case FLOAT:
9292
// single precision floating point, 4 bytes
9393
return typeFactory.createSqlType(SqlTypeName.FLOAT);

0 commit comments

Comments
 (0)