public static void checkTimestampPrecision(long time) {
    final boolean isTimestampPrecisionCheckEnabled =
        CommonDescriptor.getInstance().getConfig().isTimestampPrecisionCheckEnabled();
    if (!isTimestampPrecisionCheckEnabled) {
      return;
    }
    switch (TIMESTAMP_PRECISION) {
      case "ms":
        if (time > 10_000_000_000_000L || time < -10_000_000_000_000L) {
          throw new SemanticException(
              String.format(
                  "The timestamp is unexpectedly large, you may forget to set the timestamp precision."
                      + "Current system timestamp precision is %s, "
                      + "please check whether the timestamp %s is correct."
                      + "If you insist to insert this timestamp, please set timestamp_precision_check_enabled=false and restart the server.",
                  TIMESTAMP_PRECISION, time));
        }
        break;
      case "us":
        if (time > 10_000_000_000_000_000L || time < -10_000_000_000_000L) {
          throw new SemanticException(
              String.format(
                  "The timestamp is unexpectedly large, you may forget to set the timestamp precision."
                      + "Current system timestamp precision is %s, "
                      + "please check whether the timestamp %s is correct."
                      + "If you insist to insert this timestamp, please set timestamp_precision_check_enabled=false and restart the server.",
                  TIMESTAMP_PRECISION, time));
        }
        break;
        // Long.MaxValue is 19 digits, therefore no problem when the precision is ns.
      case "ns":
      default:
        break;
    }
  }
check whether the input timestamp match the current system timestamp precision.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/TimestampPrecisionUtils.java