Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ private static LogicalType fromSchemaImpl(Schema schema, boolean throwErrors) {
case BIG_DECIMAL:
logicalType = BIG_DECIMAL_TYPE;
break;
case DURATION:
logicalType = DURATION_TYPE;
break;
case UUID:
logicalType = UUID_TYPE;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
* <p>
* Compared to {@link Period java.time.Period}, this class has a smaller range
* ('only' supporting a little less than 358 million years), and cannot support
* negative time periods.
* negative periods.
* </p>
*
* <p>
Expand Down Expand Up @@ -82,9 +82,9 @@
* </tr>
* <tr>
* <td>Time range (approx.)</td>
* <td>0 - 49 days</td>
* <td>0 &endash; 49 days</td>
* <td>unsupported</td>
* <td>-68 - 68 years</td>
* <td>-68 &endash; 68 years</td>
* </tr>
* <tr>
* <td>Date range (approx.)</td>
Expand All @@ -95,7 +95,7 @@
* </table>
*
* @see <a href=
* "https://avro.apache.org/docs/1.11.1/specification/#duration">Avro 1.11
* "https://avro.apache.org/docs/current/specification/#duration">Avro
* specification on duration</a>
*/
public final class TimePeriod implements TemporalAmount, Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void uuidExtendsString() {
@Test
void durationExtendsFixed12() {
Schema durationSchema = LogicalTypes.duration().addToSchema(Schema.createFixed("f", null, null, 12));
assertEquals(LogicalTypes.duration(), durationSchema.getLogicalType());
assertEquals(LogicalTypes.duration(), LogicalTypes.fromSchema(durationSchema));

assertThrows("Duration requires a fixed(12)", IllegalArgumentException.class,
"Duration can only be used with an underlying fixed type of size 12.",
Expand Down