MCPcopy Create free account
hub / github.com/apache/paimon-rust / call

Method call

crates/integrations/datafusion/src/full_text_search.rs:89–125  ·  view source on GitHub ↗
(&self, args: &[Expr])

Source from the content-addressed store, hash-verified

87
88impl TableFunctionImpl for FullTextSearchFunction {
89 fn call(&self, args: &[Expr]) -> DFResult<Arc<dyn TableProvider>> {
90 if args.len() != 4 {
91 return Err(datafusion::error::DataFusionError::Plan(
92 "full_text_search requires 4 arguments: (table_name, column_name, query_text, limit)".to_string(),
93 ));
94 }
95
96 let table_name = extract_string_literal(FUNCTION_NAME, &args[0], "table_name")?;
97 let column_name = extract_string_literal(FUNCTION_NAME, &args[1], "column_name")?;
98 let query_text = extract_string_literal(FUNCTION_NAME, &args[2], "query_text")?;
99 let limit = extract_int_literal(FUNCTION_NAME, &args[3], "limit")?;
100
101 if limit <= 0 {
102 return Err(datafusion::error::DataFusionError::Plan(
103 "full_text_search: limit must be positive".to_string(),
104 ));
105 }
106
107 let identifier =
108 parse_table_identifier(FUNCTION_NAME, &table_name, &self.default_database)?;
109
110 let catalog = Arc::clone(&self.catalog);
111 let table = block_on_with_runtime(
112 async move { catalog.get_table(&identifier).await },
113 "full_text_search: catalog access thread panicked",
114 )
115 .map_err(to_datafusion_error)?;
116
117 let inner = PaimonTableProvider::try_new(table)?;
118
119 Ok(Arc::new(FullTextSearchTableProvider {
120 inner,
121 column_name,
122 query_text,
123 limit: limit as usize,
124 }))
125 }
126}
127
128/// A wrapper around [`PaimonTableProvider`] that injects full-text search

Callers

nothing calls this directly

Calls 7

extract_string_literalFunction · 0.85
extract_int_literalFunction · 0.85
parse_table_identifierFunction · 0.85
block_on_with_runtimeFunction · 0.85
PlanClass · 0.50
lenMethod · 0.45
get_tableMethod · 0.45

Tested by

no test coverage detected