Create an ORC file writer. This is the public interface for creating writers going forward and new options will only be added to this method. @param path filename to write to @param opts the options @return a new ORC file writer @throws IOException
(Path path,
WriterOptions opts
)
| 1094 | * @throws IOException |
| 1095 | */ |
| 1096 | public static Writer createWriter(Path path, |
| 1097 | WriterOptions opts |
| 1098 | ) throws IOException { |
| 1099 | FileSystem fs = opts.getFileSystem() == null ? |
| 1100 | path.getFileSystem(opts.getConfiguration()) : opts.getFileSystem(); |
| 1101 | switch (opts.getVersion()) { |
| 1102 | case V_0_11: |
| 1103 | case V_0_12: |
| 1104 | return new WriterImpl(fs, path, opts); |
| 1105 | case UNSTABLE_PRE_2_0: |
| 1106 | return new WriterImplV2(fs, path, opts); |
| 1107 | default: |
| 1108 | throw new IllegalArgumentException("Unknown version " + |
| 1109 | opts.getVersion()); |
| 1110 | } |
| 1111 | } |
| 1112 | |
| 1113 | /** |
| 1114 | * Do we understand the version in the reader? |