Reputation: 73
When i execute the following snippet of code, df1 shows no result. When i substitute the wild character "*" with a "1,2,3,.." df1 shows values. What am i missing?
from __future__ import print_function
import sys
from pyspark import SparkContext
from pyspark.sql import SQLContext
from pyspark.sql import DataFrame
import pyspark.sql.functions
.
.
.
df1= df.filter(df.DATE == "*162014").filter(df.TMC == "111N04908")\
.sort(df.EPOCH.asc())
Upvotes: 3
Views: 9668
Reputation: 891
This should work
df1 = df.filter(df.DATE.rlike('*162014'))
.filter(df.TMC == "111N04908")
.sort(df.EPOCH.asc())
where or filter both are same
df1 = df.where(df.DATE.rlike('*162014'))
.where(df.TMC == "111N04908")
.sort(df.EPOCH.asc())
Upvotes: 1