当前位置:首页 > 报告详情

Flink 2.1:面向数据和人工智能的 SQL 高级功能.pdf

上传人: 可*** 编号:991741 2025-12-07 27页 4.46MB

1、Flink 2.1:SQL Advances for Data+AIBridging real-time data processing and AI in Flink SQLLincoln Lee Alibaba CloudStaff Engineer,Apache Flink PMCLLM UDFIntegrate AI Analytics into Real-Time PipelineHuman Reviewtable product(id BIGINT,title VARCHAR,country INT category VARCHAR)table risk_output(id BIG

2、INT,title VARCHAR,forbidden_words VARCHAR hit_keywords VARCHAR)Product title:grape juice(no alcohol)LLMUnderstand no alcoholMeans doesnt contain alcoholno riskclass OpenAIUDF extends ScalarFunction void open()/initOpenAIClient.String eval(String title)/1.prepare ChatCompletionCreateParams/2.return c

3、lient.chat().completions().create.The Hidden Costs of Custom AI UDFLLM UDFOpenAItry different models 1 seconds3 secondssynchronize requestlow throughput async request higher throughputScalarFunctionAsyncScalarFunctionrewrite coderewrite codeApache Flink SQL Native AI FunctionCreate ModelCREATE MODEL

4、 my_modelINPUT(input STRING)OUTPUT(content STRING)WITH(provider=openai/modelScope/,model=gpt-4o/deepseek/qwen/,endpoint=https:/,systemPrompt=)Chat/CompletionSELECT *,content as ai_result FROM ML_PREDICT(TABLE user_feedbacks,MODELmy_model,DESCRIPTOR(feedback),MAPasync,true)SELECT *,content as feature

5、sFROM ML_PREDICT(TABLE input,MODELmy_embedding_model,DESCRIPTOR(question),MAPasync,true)Embeddingmodel managementSQL AI function JSON is important for AIJSON Everywhere:From Big Data to AISearch documentEvent logsJSON_QUERYJSON_VALUEJSON_STRINGJSON_OBJECTJSON_EXISTSJSON_ARRAYSemi-structured JSON Dat

6、aBuilt-in JSON FunctionsProcess JSON StringRAG documentLLM prompts/outputAPI payload JSONJSONparsing”events The Hidden Cost of JSON ParsinguserId:u123,events:type:click,ts:1717230000,type:purchase,ts:1717230033,amount:59.9,metadata:browser:Chrome,device:MobileJSON DocumentRequires parsing every time

word格式文档无特别注明外均可编辑修改,预览文件经过压缩,下载原文更清晰!
三个皮匠报告文库所有资源均是客户上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作商用。
根据《Flink 2.1: SQL Advances for Data + AI》的内容,以下是全文关键点的概括: 1. **Flink SQL AI功能增强**: - 引入LLM UDF(标量函数)和OpenAI UDF,实现AI分析实时集成。 - 创建模型和预测功能,如`ML_PREDICT`。 2. **JSON处理优化**: - 引入新的变体类型,优化JSON解析和处理。 3. **流式数据处理**: - 提出无状态Delta Join,解决状态管理挑战。 - 优化多路连接,减少冗余状态。 4. **RAG(检索-推理-评估)管道**: - 支持从文本到多模态的检索和推理。 - 提供完全声明式的RAG管道。 5. **性能优化**: - DeltaJoin减少100TB状态,检查点时间从90秒缩短到1秒。 - 降低85%的Flink CPU和内存资源使用。 6. **未来路线图**: - 更多AI管道支持。 - 连接优化,如DeltaJoin和Calc操作。
"Flink SQL AI加速,你准备好了吗?" AI赋能实时数据处理!" "Flink SQL新功能,AI实时分析更高效!"
客服
商务合作
小程序
服务号
折叠