Single line url in mpad


#1

is there any way to give url in single line in mapd
eg:
postgresuri: ‘postgresql://root:login123@thickset-dev-postgres.cu9mypqoftvu.us-east-1.rds.amazonaws.com’


#2

Hi @nagulan -

Could you provide some more context? Where are you trying to provide a URL to?

Thanks,
Randy


#3

username : “mapd”
password : “HyperInteractive”
hostname : “deepbox.thickdata.io
dbname : “mapd”
self.engine_mapd = connect(user=“mapd”, password=“HyperInteractive”, host=“deepbox.thickdata.io”, dbname=“mapd”)

how to use this in single line like above postgres url


#4

It’s still not really clear to me what programming language/package you are using, but please see this example line from pymapd, which shows an example similar to what I think you are talking about:


#5

@randyzwitch
thank you i got it
and is there any way to extract( yyyy-mm-dd) or fromat from a date column
how to use date function for this


#6

in python? you can format as you want

e.g.

res = conn.execute(“select max(flight_timestamp), min(flight_timestamp) from flights”).fetchone()
print res
(datetime.date(2008, 12, 31), datetime.date(1987, 10, 1))

print res[1]
1987-10-01

print res[1].strftime(’%d-%m-%Y’)
01-10-1987

print res[1].strftime(’%d-%b-%Y’)
01-Oct-1987

print res[1].strftime(’%d-%b-%y’)
01-Oct-87

and so on