Question: I have url like this `http://example.com/dir1/dir2/dir3/dir4/Page.php?charts.htm` and I need to remove the page/extension before the querystring so it outputs `http://example.com/dir1/dir2/dir3/dir4/?charts.htm` 

```
$url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$temp = explode( '?'  , $url );
$temp[0] = ""; //remove part before the ?

```

Not even sure if I'm on the right track here

Answer: 
insert overwrite directory 'EXTERNAL\_DIRECTORY' STORED AS PARQUET select \* from SOURCE\_TABLE\_NAME;
First you need to create one table with the schema of your results in hive **stored as parquet**. After getting the results you can export them into the parquet file format table like this

```
insert into table parquet_file_table_name select * from table_name_containing_results

```

For more information you can refer to the below link

<https://acadgild.com/blog/parquet-file-format-hadoop/>