You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "joonseolee (via GitHub)" <gi...@apache.org> on 2025/08/24 23:08:51 UTC
[PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
joonseolee opened a new pull request, #9760:
URL: https://github.com/apache/seatunnel/pull/9760
<!--
Thank you for contributing to SeaTunnel! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
## Contribution Checklist
- Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/seatunnel/issues).
- Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
- Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
-->
### Purpose of this pull request
<!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released SeaTunnel versions or within the unreleased branches such as dev.
If no, write 'No'.
If you are adding/modifying connector documents, please follow our new specifications: https://github.com/apache/seatunnel/issues/4544.
-->
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
If you are adding E2E test cases, maybe refer to https://github.com/apache/seatunnel/blob/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-mysql-e2e/src/test/resources/mysqlcdc_to_mysql.conf, here is a good example.
-->
### Check list
* [X] If any new Jar binary package adding in your PR, please add License Notice according
[New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/contribution/new-license.md)
* [X] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs
* [X] If you are contributing the connector code, please check that the following files are updated:
1. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
2. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
3. Add ci label in [label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml)
4. Add e2e testcase in [seatunnel-e2e](https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/)
5. Update connector [plugin_config](https://github.com/apache/seatunnel/blob/dev/config/plugin_config)
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "joonseolee (via GitHub)" <gi...@apache.org>.
joonseolee commented on code in PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#discussion_r2314617190
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/test/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/MarkdownReadStrategyTest.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.file.source.reader;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.net.URL;
+import java.nio.file.Paths;
+
+
+class MarkdownReadStrategyTest {
+
+ @Test
+ public void testReadMarkdown() throws Exception {
Review Comment:
@Hisoka-X
Thank you ! I have done it
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][File] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "corgy-w (via GitHub)" <gi...@apache.org>.
corgy-w commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3265689523
@joonseolee Wait for the completion of the document pr I will merge together
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "joonseolee (via GitHub)" <gi...@apache.org>.
joonseolee commented on code in PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#discussion_r2314617686
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/MarkdownReadStrategy.java:
##########
@@ -0,0 +1,253 @@
+/*
+ * 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.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.file.source.reader;
+
+import com.vladsch.flexmark.ast.*;
Review Comment:
@Hisoka-X
I have done it all. Can you check it again?
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "joonseolee (via GitHub)" <gi...@apache.org>.
joonseolee commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3251263926
@Hisoka-X
Can you check the below again?
I have passed all tests excluding `unit-test (8, windows-latest)`.
It printed the message like this.
```bash
Write Count So Far : 0
Average Read Count : 0/s
Average Write Count : 0/s
Last Statistic Time : 2025-09-04 00:39:30
Current Statistic Time : 2025-09-04 00:40:30
***********************************************
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
org.apache.seatunnel.engine.common.loader.SeaTunnelChildFirstClassLoader@7767ea8d
Terminate batch job (Y/N)?
Error: The operation was canceled.
```
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3253951405
Please re-trigger the failed ci. Maybe it just unstable.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][File] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "joonseolee (via GitHub)" <gi...@apache.org>.
joonseolee commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3269744755
@corgy-w
I already modified the files and opened a PR, so are you saying that you are going to write the documentation instead of me?
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "joonseolee (via GitHub)" <gi...@apache.org>.
joonseolee commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3222875823
> > I should add it to the FileFormat enum and implement a corresponding ReadStrategy?
>
> Yes.
>
Ah, then for now, in this ticket, should I just proceed with the things mentioned above?
I’ll make sure that the chunk related functionality is discussed in ticket #9717.
And I’ll try to develop it as quickly as possible so that I can submit a PR soon.
cc @iinow
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3249463462
Hi @joonseolee . Thanks for update! Please follow the guide to open github action on your fork repository. https://github.com/apache/seatunnel/pull/9760/checks?check_run_id=49358045346
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][File] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "joonseolee (via GitHub)" <gi...@apache.org>.
joonseolee commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3270866682
@zhangshenghang
Sorry, I didn’t check it properly. To explain in more detail, as you saw in the code, I divided it based on Heading, Paragraph, ListItem, BulletList, OrderedList, BlockQuote, FencedCodeBlock, and TableBlock. Elements like image, bold, and italic are only defined as syntax within those blocks. It would be better to divide them in more detail, but for now I set it up so that the bigger sections are separated while image, bold, and italic retain their syntax. If you think my approach is lacking, I can update it right away.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "joonseolee (via GitHub)" <gi...@apache.org>.
joonseolee commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3230431989
@Hisoka-X
For this ticket, I have added the markdown read strategy first, and I plan to focus on improvements in the split ticket #9717 next.
I have worked on this again. Could you please take a look when you have a moment?
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on code in PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#discussion_r2306101859
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/FileFormat.java:
##########
@@ -167,7 +159,21 @@ public ReadStrategy getReadStrategy() {
throw new UnsupportedOperationException(
"File format 'maxwell_json' does not support reading.");
}
- };
+ },
+ MARKDOWN("md", "markdown") {
+ @Override
+ public WriteStrategy getWriteStrategy(FileSinkConfig fileSinkConfig) {
+ throw new UnsupportedOperationException(
+ "File format 'markdown' does not support reading.");
Review Comment:
```suggestion
"File format 'markdown' does not support writing.");
```
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/MarkdownReadStrategy.java:
##########
@@ -0,0 +1,163 @@
+/*
+ * 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.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.file.source.reader;
+
+import com.vladsch.flexmark.ast.*;
+import com.vladsch.flexmark.ext.tables.TableBlock;
+import com.vladsch.flexmark.ext.tables.TableCell;
+import com.vladsch.flexmark.ext.tables.TableRow;
+import com.vladsch.flexmark.parser.Parser;
+import com.vladsch.flexmark.util.ast.Node;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.seatunnel.api.source.Collector;
+import org.apache.seatunnel.api.table.type.BasicType;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.api.table.type.SeaTunnelRowType;
+import org.apache.seatunnel.connectors.seatunnel.file.exception.FileConnectorException;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+public class MarkdownReadStrategy extends AbstractReadStrategy {
+
+ @Override
+ public void read(String path, String tableId, Collector<SeaTunnelRow> output) throws IOException, FileConnectorException {
+ String markdown = new String(Files.readAllBytes(Paths.get(path)));
+ Parser parser = Parser.builder().build();
+ Node document = parser.parse(markdown);
+
+ List<SeaTunnelRow> rows = new ArrayList<>();
+ traverse(document, rows);
+
+ for (SeaTunnelRow row : rows) {
+ output.collect(row);
+ }
+ }
+
+ private void traverse(Node node, List<SeaTunnelRow> rows) {
+ for (Node child = node.getFirstChild(); child != null; child = child.getNext()) {
+ String type = child.getClass().getSimpleName();
+
+ if (child instanceof Heading || child instanceof Paragraph || child instanceof ListItem ||
+ child instanceof BulletList || child instanceof OrderedList ||
+ child instanceof BlockQuote || child instanceof FencedCodeBlock ||
+ child instanceof TableBlock) {
+ String value = extractValue(child);
+ if (value != null && !value.trim().isEmpty()) {
+ rows.add(new SeaTunnelRow(new Object[]{type, value.trim()}));
+ log.debug("Added row: type={} value={}", type, value.trim());
+ }
+ continue;
+ }
+
+ traverse(child, rows);
+ }
+ }
+
+ private String extractValue(Node node) {
+ if (node instanceof Heading || node instanceof Paragraph || node instanceof ListItem) {
+ return extractTextFromChildren(node);
+ } else if (node instanceof BulletList) {
+ return bulletListToString((BulletList) node);
+ } else if (node instanceof OrderedList) {
+ return orderedListToString((OrderedList) node);
+ } else if (node instanceof Code) {
+ return ((Code) node).getText().toString();
+ } else if (node instanceof FencedCodeBlock) {
+ return ((FencedCodeBlock) node).getContentChars().toString();
+ } else if (node instanceof BlockQuote) {
+ return extractTextFromChildren(node);
+ } else if (node instanceof ThematicBreak) {
+ return "---";
+ } else if (node instanceof Link) {
+ return ((Link) node).getUrl().toString();
+ } else if (node instanceof Image) {
+ return ((Image) node).getUrl().toString();
+ } else if (node instanceof TableBlock) {
+ return tableToString((TableBlock) node);
+ }
+ return node.getChars().toString();
+ }
+
+ private String extractTextFromChildren(Node node) {
+ StringBuilder sb = new StringBuilder();
+ for (Node child = node.getFirstChild(); child != null; child = child.getNext()) {
+ sb.append(child.getChars());
+ }
+
+ return sb.toString().trim();
+ }
+
+ private String bulletListToString(BulletList list) {
+ StringBuilder sb = new StringBuilder();
+ for (Node item = list.getFirstChild(); item != null; item = item.getNext()) {
+ if (item instanceof ListItem) {
+ sb.append("- ")
+ .append(extractTextFromChildren(item))
+ .append("\n");
+ }
+ }
+
+ return sb.toString();
+ }
+
+ private String orderedListToString(OrderedList list) {
+ StringBuilder sb = new StringBuilder();
+ int num = 1;
+ for (Node item = list.getFirstChild(); item != null; item = item.getNext()) {
+ if (item instanceof ListItem) {
+ sb.append(num++)
+ .append(". ")
+ .append(extractTextFromChildren(item))
+ .append("\n");
+ }
+ }
+
+ return sb.toString();
+ }
+
+ private String tableToString(TableBlock table) {
+ StringBuilder sb = new StringBuilder();
+ for (Node row = table.getFirstChild(); row != null; row = row.getNext()) {
+ if (row instanceof TableRow) {
+ for (Node cell = row.getFirstChild(); cell != null; cell = cell.getNext()) {
+ if (cell instanceof TableCell) {
+ sb.append(((TableCell) cell).getText().toString()).append(" | ");
+ }
+ }
+ sb.append("\n");
+ }
+ }
+
+ return sb.toString();
+ }
+
+ @Override
+ public SeaTunnelRowType getSeaTunnelRowTypeInfo(String path) throws FileConnectorException {
+ return new SeaTunnelRowType(
+ new String[]{"type", "value"},
+ new org.apache.seatunnel.api.table.type.SeaTunnelDataType[]{
+ BasicType.STRING_TYPE, BasicType.STRING_TYPE
Review Comment:
The row fields too simple.
We should contains:
- element_id
- element_type
- heading_level
- text
- page_number
- position_index
- parent_id
- child_ids
For example:
```markdown
# Data Source Configuration
## Kafka Configuration
Users can configure Kafka by specifying the bootstrap.servers, topic, and group.id.
## MySQL Configuration
MySQL requires a JDBC URL, username, and password.
### Notes
Make sure to test the connection before deploying.
```
The row should be
```json
{
"element_id": "uuid-elem-1",
"element_type": "heading",
"heading_level": 1,
"text": "Data Source Configuration",
"page_number": null,
"position_index": 0,
"parent_id": null,
"child_ids": ["uuid-elem-2","uuid-elem-4"],
}
{
"element_id": "uuid-elem-2",
"element_type": "heading",
"heading_level": 2,
"text": "Kafka Configuration",
"page_number": null,
"position_index": 1,
"parent_id": "uuid-elem-1",
"child_ids": ["uuid-elem-3"]
}
{
"element_id": "uuid-elem-3",
"element_type": "paragraph",
"heading_level": null,
"text": "Users can configure Kafka by specifying the bootstrap.servers, topic, and group.id.",
"page_number": null,
"position_index": 2,
"parent_id": "uuid-elem-2",
"child_ids": []
}
{
"element_id": "uuid-elem-4",
"element_type": "heading",
"heading_level": 2,
"text": "MySQL Configuration",
"page_number": null,
"position_index": 3,
"parent_id": "uuid-elem-1",
"child_ids": ["uuid-elem-5","uuid-elem-6"]
}
{
"element_id": "uuid-elem-5",
"element_type": "paragraph",
"heading_level": null,
"text": "MySQL requires a JDBC URL, username, and password.",
"page_number": null,
"position_index": 4,
"parent_id": "uuid-elem-4",
"child_ids": []
}
{
"element_id": "uuid-elem-6",
"element_type": "heading",
"heading_level": 3,
"text": "Notes",
"page_number": null,
"position_index": 5,
"parent_id": "uuid-elem-4",
"child_ids": ["uuid-elem-7"]
}
{
"element_id": "uuid-elem-7",
"element_type": "paragraph",
"heading_level": null,
"text": "Make sure to test the connection before deploying.",
"page_number": null,
"position_index": 6,
"parent_id": "uuid-elem-6",
"child_ids": []
}
```
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][File] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang merged PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3257593415
Hi @joonseolee . Could you update the docs with another PR?
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][File] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3270802417
> @zhangshenghang
>
> Of course, I also made it so that the image links can be extracted.
@joonseolee However, I don't seem to have found any specialized logic for processing images.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "joonseolee (via GitHub)" <gi...@apache.org>.
joonseolee commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3259855967
@Hisoka-X
Got it. I will make a PR about that :)
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3218907951
Hi @joonseolee , thanks for your PR.
However, this implementation may require some adjustments before it can be merged.
1. We should add new format in https://github.com/apache/seatunnel/blob/555f6c6096a46c7ad3d9a022b42b0008e6a460e1/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/FileFormat.java#L46
2. We should use file series source to read markdown file and parse it in `MarkdownReadStrategy` added by step 1.
So all function in file source connector, not another transform. Please refer https://github.com/apache/seatunnel/blob/dev/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/MultipleTableFileSourceReader.java#L42
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on code in PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#discussion_r2313950862
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/MarkdownReadStrategy.java:
##########
@@ -0,0 +1,253 @@
+/*
+ * 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.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.file.source.reader;
+
+import com.vladsch.flexmark.ast.*;
Review Comment:
Please run `mvn spotless:apply` to fix code style.
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/test/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/MarkdownReadStrategyTest.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.file.source.reader;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.net.URL;
+import java.nio.file.Paths;
+
+
+class MarkdownReadStrategyTest {
+
+ @Test
+ public void testReadMarkdown() throws Exception {
Review Comment:
Could you test all field value in one row?
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3222938498
> Ah, then for now, in this ticket, should I just proceed with the things mentioned above?
Choose the way you like :)
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "joonseolee (via GitHub)" <gi...@apache.org>.
joonseolee commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3222007583
@Hisoka-X
Thank you for your comment ! :))
So, is my understanding correct that instead of adding the new format (Markdown) to the `seatunnel-transforms-v2` module, I should add it to the `FileFormat` enum and implement a corresponding `ReadStrategy`? And based on the `chunkSize` and `overlap` values, I can create a new class similar to `MultipleTableFileSourceReader` to convert it into structured data. Additionally, I should implement a new `SourceSplit`, for example, by creating something like `RagFileSourceSplit`.
cc @iinow
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3222408289
> I should add it to the FileFormat enum and implement a corresponding ReadStrategy?
Yes.
> And based on the chunkSize and overlap values, I can create a new class similar to MultipleTableFileSourceReader to convert it into structured data. Additionally, I should implement a new SourceSplit, for example, by creating something like RagFileSourceSplit.
No, the MultipleTableFileSourceReader and SourceSplit used by all FileFormat.
MultipleTableFileSourceReader used to read file path, ReadStrategy used to parse data in file.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][File] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3269660411
@joonseolee Can the image links in Markdown be parsed?
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "joonseolee (via GitHub)" <gi...@apache.org>.
joonseolee commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3257309139
@Hisoka-X
Finally! I have passed all CI!
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][File] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "joonseolee (via GitHub)" <gi...@apache.org>.
joonseolee commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3269750234
@zhangshenghang
Of course, I also made it so that the image links can be extracted.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][File] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3288481600
> @zhangshenghang
>
> Sorry, I didn’t check it properly. To explain in more detail, as you saw in the code, I divided it based on Heading, Paragraph, ListItem, BulletList, OrderedList, BlockQuote, FencedCodeBlock, and TableBlock. Elements like image, bold, and italic are only defined as syntax within those blocks. It would be better to divide them in more detail, but for now I set it up so that the bigger sections are separated while image, bold, and italic retain their syntax. If you think my approach is lacking, I can update it right away.
@joonseolee thanks, It is necessary to focus on processing the images as it will greatly assist in the subsequent use of RAG. Others can be further developed according to your ideas.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "joonseolee (via GitHub)" <gi...@apache.org>.
joonseolee commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3218440241
@Hisoka-X @iinow
I have studied this project as much as possible and added the RAG functionality, but since this is my first time working on it, there may be parts that I missed. If you could let me know about those parts, I will make sure to correct them immediately.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][API] Add markdown parser for RAG support #9714 [seatunnel]
Posted by "joonseolee (via GitHub)" <gi...@apache.org>.
joonseolee commented on PR #9760:
URL: https://github.com/apache/seatunnel/pull/9760#issuecomment-3240508957
@Hisoka-X
I'm sorry to bother you, but could you please check it again?
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org