echauchot commented on a change in pull request #17839: URL: https://github.com/apache/flink/pull/17839#discussion_r759408311
########## File path: docs/content/docs/connectors/datastream/formats/text_files.md ########## @@ -0,0 +1,69 @@ +--- +title: "Text files" +weight: 4 +type: docs +aliases: +- /dev/connectors/formats/text_files.html +- /apis/streaming/connectors/formats/text_files.html +--- +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + + +# Text files format + +Flink supports reading from text lines from a file using `TextLineInputFormat`. This format uses Java's built-in InputStreamReader to decode the byte stream using various supported charset encodings. +To use that format you need to add the dependency below to your project: + +```xml +{{< artifact flink-connector-files >}} +``` + +The DataStream API is now compatible with both batch and streaming execution modes. +And this format is compatible with the new Source that can be used in both modes. +Thus, you can use this format in two ways: +- Bounded read for batch mode +- Continuous read for streaming mode: monitors a directory for new files that appear + +**Bounded read example**: + +In this example we create a DataStream containing the lines of a text file as Strings. +There is no need for a watermark strategy as records do not contain event timestamps. Review comment: ditto -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
