CastTimeUnit / Temporal Layer
Convert temporal values to different time unit precision, similar to pandas astype() for datetime64 or Arrow's cast operation.
Example conversions:
Original (ns) | To ms | To μs |
---|---|---|
2024-01-01 12:30:00.123456789 | ...123 | ...123456 |
2024-01-01 15:45:30.987654321 | ...987 | ...987654 |
Important notes:
- Converting to lower precision (e.g., ns → ms) loses information
- Converting to higher precision adds zeros
- Original timezone information is preserved
Common applications:
- Database compatibility
- Storage optimization
- System integration
- Time series alignment
- Performance analysis
- Log file processing
Table
0
0
Table
Transforms
[, ...]Select
columnTemporal column to convert. Must be a datetime, time, or duration type. Common sources:
- event_timestamp: System events
- created_at: Record creation time
- measurement_time: Sensor readings
- duration_ms: Operation durations
TimeUnit
enumTarget precision for temporal values. Choice affects storage size and resolution.
Millisecond ~ Microsecond ~ Nanosecond ~
Millisecond precision (10⁻³ seconds). Suitable for:
- Web application timestamps
- User interaction tracking
- Most business operations Storage: 3 decimal places
Microsecond precision (10⁻⁶ seconds). Suitable for:
- Scientific measurements
- High-frequency trading
- Performance profiling Storage: 6 decimal places
Nanosecond precision (10⁻⁹ seconds). Suitable for:
- System kernel events
- Hardware timing
- Ultra-precise measurements Storage: 9 decimal places
AsColumn
nameName for the new column. If not provided, the system generates a unique name. If AsColumn
matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.