Calculate the intersection of two [`DataFrame`]s. The two [`DataFrame`]s must have exactly the same schema ``` # use datafusion::prelude::*; # use datafusion::error::Result; # use datafusion_common::assert_batches_sorted_eq; # #[tokio::main] # async fn main() -> Result<()> { let ctx = SessionContext::new(); let df = ctx .read_csv("tests/data/example.csv", CsvReadOptions::new()) .await?; let d2 =
(self, dataframe: DataFrame)
| 1841 | /// # } |
| 1842 | /// ``` |
| 1843 | pub fn intersect(self, dataframe: DataFrame) -> Result<DataFrame> { |
| 1844 | let left_plan = self.plan; |
| 1845 | let right_plan = dataframe.plan; |
| 1846 | let plan = LogicalPlanBuilder::intersect(left_plan, right_plan, true)?; |
| 1847 | Ok(DataFrame { |
| 1848 | session_state: self.session_state, |
| 1849 | plan, |
| 1850 | projection_requires_validation: true, |
| 1851 | }) |
| 1852 | } |
| 1853 | |
| 1854 | /// Calculate the distinct intersection of two [`DataFrame`]s. The two [`DataFrame`]s must have exactly the same schema |
| 1855 | /// |