Re: Left Join at SQL query gets planned as inner join

2020-04-30 Thread Roland Johann
t; Software Developer IV > Customer Knowledge Platform > From: Roland Johann > Sent: Thursday, April 30, 2020 8:30:05 AM > To: randy clinton > Cc: Roland Johann ; user > > Subject: Re: Left Join at SQL query gets planned as inner join > > Notice: This emai

Re: Left Join at SQL query gets planned as inner join

2020-04-30 Thread Ryan C. Kleck
and the planner recognizes that. Ryan Kleck Software Developer IV Customer Knowledge Platform From: Roland Johann Sent: Thursday, April 30, 2020 8:30:05 AM To: randy clinton Cc: Roland Johann ; user Subject: Re: Left Join at SQL query gets planned as inner join

Re: Left Join at SQL query gets planned as inner join

2020-04-30 Thread Roland Johann
Thank for quick reply. It plans the LeftOuter as soon as the filters on the second table will be removed. > It seems like you are asking for a left join, but your filters demand the > behavior of an inner join. Can you explain that? The filters on the second table uses partition pruning that

Re: Left Join at SQL query gets planned as inner join

2020-04-30 Thread randy clinton
Does it still plan an inner join if you remove a filter on both tables? It seems like you are asking for a left join, but your filters demand the behavior of an inner join. Maybe you could do the filters on the tables first and then join them. Something roughly like.. s_DF = s_DF.filter(year =

Left Join at SQL query gets planned as inner join

2020-04-30 Thread Roland Johann
Hi All, we are on vanilla Spark 2.4.4 and currently experience a somehow strange behavior of the query planner/optimizer and therefore get wrong results. select s.event_id as search_event_id, s.query_string, p.event_id from s left outer join p on s.event_id = p.source_event_id