@Override
  public TableFunctionAnalysis analyze(Map<String, Argument> arguments) throws UDFException {
    // there are different error type.
    ScalarArgument n = (ScalarArgument) arguments.get("N");
    int nValue = (int) n.getValue();
    if (nValue == 0) {
      // do not set required columns
      return TableFunctionAnalysis.builder()
          .properColumnSchema(
              DescribedSchema.builder().addField("proper_column", Type.INT32).build())
          .handle(new MapTableFunctionHandle())
          .build();
    } else if (nValue == 1) {
      // set empty required columns
      return TableFunctionAnalysis.builder()
          .properColumnSchema(
              DescribedSchema.builder().addField("proper_column", Type.INT32).build())
          .requiredColumns(TBL_PARAM, Collections.emptyList())
          .handle(new MapTableFunctionHandle())
          .build();
    } else if (nValue == 2) {
      // set negative required columns
      return TableFunctionAnalysis.builder()
          .properColumnSchema(
              DescribedSchema.builder().addField("proper_column", Type.INT32).build())
          .requiredColumns(TBL_PARAM, Collections.singletonList(-1))
          .handle(new MapTableFunctionHandle())
          .build();
    } else if (nValue == 3) {
      // set required columns out of bound (0~10)
      return TableFunctionAnalysis.builder()
          .properColumnSchema(
              DescribedSchema.builder().addField("proper_column", Type.INT32).build())
          .requiredColumns(TBL_PARAM, IntStream.range(0, 11).boxed().collect(Collectors.toList()))
          .handle(new MapTableFunctionHandle())
          .build();
    } else if (nValue == 4) {
      // specify required columns to unknown table
      return TableFunctionAnalysis.builder()
          .properColumnSchema(
              DescribedSchema.builder().addField("proper_column", Type.INT32).build())
          .requiredColumns("TIMECHO", Collections.singletonList(1))
          .handle(new MapTableFunctionHandle())
          .build();
    }
    throw new UDFArgumentNotValidException("unexpected argument value");
  }
It is a table function with wrong implementation, which is only used for testing.
integration-test/src/main/java/org/apache/iotdb/db/query/udf/example/relational/MyErrorTableFunction.java