Skip to content

Commit

Permalink
Update error doc
Browse files Browse the repository at this point in the history
  • Loading branch information
linghengqian committed Dec 12, 2023
1 parent 0c5d2a8 commit b1584f8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ weight = 10
2. `SP` 代表 suffix pattern 的缩写,意为结果列表单元的后缀的时间戳格式, 通常代表真实表的后缀格式,必须遵循 Java DateTimeFormatter 的格式。
例如:yyyyMMdd,yyyyMM 或 yyyy 等。
3. `DIA` 代表 datetime interval amount 的缩写,意为结果列表单元的时间间隔。
4. `DIU` 代表 datetime interval unit 的缩写,意为分片键时间间隔单位,必须遵循 Java ChronoUnit 的枚举值。例如:`Months`
5. `DL` 代表 datetime lower 的缩写,意为时间上界值,格式与 `SP` 定义的时间戳格式一致。
4. `DIU` 代表 datetime interval unit 的缩写,意为分片键时间间隔单位,必须遵循 Java `java.time.temporal.ChronoUnit#toString()` 的枚举值。例如:`Months`
5. `DL` 代表 datetime lower 的缩写,意为时间下界值,格式与 `SP` 定义的时间戳格式一致。
6. `DU` 代表 datetime upper 的缩写,意为时间上界值,格式与 `SP` 定义的时间戳格式一致。
7. `C` 代表 chronology 的缩写,意为日历系统,必须遵循 Java `java.time.chrono.Chronology#getId()` 的格式。
例如:`Japanese``Minguo``ThaiBuddhist`。存在默认值为 `ISO`
Expand All @@ -60,9 +60,9 @@ weight = 10
- `<INTERVAL>P=t_order_;SP=HH_mm_ss_SSS;DIA=1;DIU=Millis;DL=22_48_52_131;DU=22_48_52_133` 将被转化为 `t_order_22_48_52_131, t_order_22_48_52_132, t_order_22_48_52_133`
- `<INTERVAL>P=t_order_;SP=yyyy_MM_dd_HH_mm_ss_SSS;DIA=1;DIU=Days;DL=2023_12_04_22_48_52_131;DU=2023_12_06_22_48_52_131` 将被转化为 `t_order_2023_12_04_22_48_52_131, t_order_2023_12_05_22_48_52_131, t_order_2023_12_06_22_48_52_131`
- `<INTERVAL>P=t_order_;SP=MM;DIA=1;DIU=Months;DL=10;DU=12` 将被转化为 `t_order_10, t_order_11, t_order_12`
- `<INTERVAL.JAPANESE.DATE>P=t_order_;SP=GGGGyyyy_MM_dd;DIA=1;DIU=Days;DL=平成0001_12_05;DU=平成0001_12_06;C=Japanese` 将被转化为 `t_order_平成0001_12_05, t_order_平成0001_12_06`
- `<INTERVAL.JAPANESE.DATE>P=t_order_;SP=GGGGyyy_MM_dd;DIA=1;DIU=Days;DL=平成001_12_05;DU=平成001_12_06;C=Japanese` 将被转化为 `t_order_平成001_12_05, t_order_平成001_12_06`
- `<INTERVAL.JAPANESE.DATE>P=t_order_;SP=GGGGy_MM_dd;DIA=1;DIU=Days;DL=平成1_12_05;DU=平成1_12_06;C=Japanese` 将被转化为 `t_order_平成1_12_05, t_order_平成1_12_06`
- `<INTERVAL>P=t_order_;SP=GGGGyyyy_MM_dd;DIA=1;DIU=Days;DL=平成0001_12_05;DU=平成0001_12_06;C=Japanese` 将被转化为 `t_order_平成0001_12_05, t_order_平成0001_12_06`
- `<INTERVAL>P=t_order_;SP=GGGGyyy_MM_dd;DIA=1;DIU=Days;DL=平成001_12_05;DU=平成001_12_06;C=Japanese` 将被转化为 `t_order_平成001_12_05, t_order_平成001_12_06`
- `<INTERVAL>P=t_order_;SP=GGGGy_MM_dd;DIA=1;DIU=Days;DL=平成1_12_05;DU=平成1_12_06;C=Japanese` 将被转化为 `t_order_平成1_12_05, t_order_平成1_12_06`

## 基于 GraalVM Truffle 的 Espresso 实现的使用 Groovy 语法的行表达式

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ It usually represents the suffix format of the real table and must follow the fo
For example: yyyyMMdd, yyyyMM or yyyy etc.
3. `DIA` stands for the abbreviation of datetime interval amount, which means the time interval of the result list unit.
4. `DIU` stands for the abbreviation of datetime interval unit, which means the shard key time interval unit.
It must follow the enumeration value of Java ChronoUnit. For example: `Months`.
5. `DL` stands for the abbreviation of datetime lower, which means the upper bound of time. The format is consistent with the timestamp format defined by `SP`.
It must follow the enumeration value of Java `java.time.temporal.ChronoUnit#toString()`. For example: `Months`.
5. `DL` stands for the abbreviation of datetime lower, which means the lower bound of time. The format is consistent with the timestamp format defined by `SP`.
6. `DU` stands for the abbreviation of datetime upper, which means the upper bound value of time. The format is consistent with the timestamp format defined by `SP`.
7. `C` stands for the abbreviation of chronology, which means calendar system and must follow the format of Java `java.time.chrono.Chronology#getId()`.
For example: `Japanese`, `Minguo`, `ThaiBuddhist`. There is a default value of `ISO`.
Expand All @@ -68,9 +68,9 @@ Example:
- `<INTERVAL>P=t_order_;SP=HH_mm_ss_SSS;DIA=1;DIU=Millis;DL=22_48_52_131;DU=22_48_52_133` will be converted to `t_order_22_48_52_131, t_order_22_48_52_132, t_order_22_48_52_133`
- `<INTERVAL>P=t_order_;SP=yyyy_MM_dd_HH_mm_ss_SSS;DIA=1;DIU=Days;DL=2023_12_04_22_48_52_131;DU=2023_12_06_22_48_52_131` will be converted to `t_order_2023_12_04_22_48_52_131, t_order_2023_12_05_22_48_52_131, t_order_2023_12_06_22_48_52_131`
- `<INTERVAL>P=t_order_;SP=MM;DIA=1;DIU=Months;DL=10;DU=12` will be converted to `t_order_10, t_order_11, t_order_12`
- `<INTERVAL.JAPANESE.DATE>P=t_order_;SP=GGGGyyyy_MM_dd;DIA=1;DIU=Days;DL=平成0001_12_05;DU=平成0001_12_06;C=Japanese` will be converted to `t_order_平成0001_12_05, t_order_平成0001_12_06`
- `<INTERVAL.JAPANESE.DATE>P=t_order_;SP=GGGGyyy_MM_dd;DIA=1;DIU=Days;DL=平成001_12_05;DU=平成001_12_06;C=Japanese` will be converted to `t_order_平成001_12_05, t_order_平成001_12_06`
- `<INTERVAL.JAPANESE.DATE>P=t_order_;SP=GGGGy_MM_dd;DIA=1;DIU=Days;DL=平成1_12_05;DU=平成1_12_06;C=Japanese` will be converted to `t_order_平成1_12_05, t_order_平成1_12_06`
- `<INTERVAL>P=t_order_;SP=GGGGyyyy_MM_dd;DIA=1;DIU=Days;DL=平成0001_12_05;DU=平成0001_12_06;C=Japanese` will be converted to `t_order_平成0001_12_05, t_order_平成0001_12_06`
- `<INTERVAL>P=t_order_;SP=GGGGyyy_MM_dd;DIA=1;DIU=Days;DL=平成001_12_05;DU=平成001_12_06;C=Japanese` will be converted to `t_order_平成001_12_05, t_order_平成001_12_06`
- `<INTERVAL>P=t_order_;SP=GGGGy_MM_dd;DIA=1;DIU=Days;DL=平成1_12_05;DU=平成1_12_06;C=Japanese` will be converted to `t_order_平成1_12_05, t_order_平成1_12_06`

## Row Value Expressions that uses the Groovy syntax based on GraalVM Truffle's Espresso implementation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,15 @@ private ChronoUnit getStepUnit(final Map<String, String> props) {
}

private Chronology getChronology(final Map<String, String> props) {
return props.containsKey(CHRONOLOGY_KEY)
? Chronology.getAvailableChronologies()
.stream()
.filter(chronologyInstance -> chronologyInstance.getId().equals(props.get(CHRONOLOGY_KEY)))
.findFirst()
.orElseThrow(() -> new RuntimeException(String.format("Cannot find step unit for specified %s property: `%s`", INTERVAL_UNIT_KEY, stepUnit)))
: IsoChronology.INSTANCE;
if (props.containsKey(CHRONOLOGY_KEY)) {
String chronology = props.get(CHRONOLOGY_KEY);
return Chronology.getAvailableChronologies()
.stream()
.filter(chronologyInstance -> chronologyInstance.getId().equals(chronology))
.findFirst()
.orElseThrow(() -> new RuntimeException(String.format("Cannot find chronology for specified %s property: `%s`", CHRONOLOGY_KEY, chronology)));
}
return IsoChronology.INSTANCE;
}

private List<String> split() {
Expand Down

0 comments on commit b1584f8

Please sign in to comment.