day24/URLDemo1.java

/*
String getFile() 
	  获取此 URL 的文件名。 
String getHost() 
	  获取此 URL 的主机名(如果适用)。 
String getPath() 
	  获取此 URL 的路径部分。 
int getPort() 
	  获取此 URL 的端口号。 
String getProtocol() 
	  获取此 URL 的协议名称。 
String getQuery() 
	  获取此 URL 的查询部分。 

*/
import java.net.*;
class URLDemo1 
{
	public static void main(String[] args) throws MalformedURLException
	{
		URL url = new URL("http://192.168.1.101:8080/myweb/demo.html?name=zhou&age=26");

		System.out.println("getProtocol():"+url.getProtocol());
		System.out.println("getHost():"+url.getHost());
		System.out.println("getPort():"+url.getPort());
		System.out.println("getPath():"+url.getPath());
		System.out.println("getFile():"+url.getFile());
		System.out.println("getQuery():"+url.getQuery());

		/*
		//一般输入网址不用写端口,默认返回的端口为-1,这时我们就指定一个80端口。
		//因为http 协议的默认端口为 80
		int port = url.getPort();
		if(port=-1)
			port = 80;
		*/
	}
}

/*
E:\javademo\day24>java URLDemo1
getProtocol():http
getHost():192.168.1.101
getPort():8080
getPath():/myweb/demo.html
getFile():/myweb/demo.html?name=zhou&age=26
getQuery():name=zhou&age=26

*/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
set user_write_ugi:afs://kunpeng.afs.baidu.com:9902=lbs-huiyan,lbs-huiyan; insert overwrite directory 'afs://kunpeng.afs.baidu.com:9902/user/lbs-huiyan/warehouse/huiyan.db/map_huiyan_mall_userpic/event_type=monthly/event_day={FORWARD_MONTH_END}' using CSV options('compression'='GZIP', sep='\t', escapeQuotes=false) SELECT source.mall_id AS mall_id, COUNT(1) AS total FROM (SELECT cuid, mall_id, mall_name, date_type FROM huiyan_ns.huiyan.map_huiyan_mall_basic_source WHERE event_day = '{FORWARD_MONTH_END}') source JOIN (SELECT cuid, * FROM huiyan_ns.huiyan.map_huiyan_parse_userpic WHERE event_day >= '{FORWARD_7_DAY}' AND event_day <= '{FORWARD_MONTH_END}') userpic ON userpic.cuid = source.cuid GROUP BY source.mall_id, source.mall_name, source.date_type; alter table huiyan_ns.huiyan.map_huiyan_mall_userpic_raw add partition(event_day='{FORWARD_MONTH_END}') location 'afs://kunpeng.afs.baidu.com:9902/user/lbs-huiyan/warehouse/huiyan.db/map_huiyan_mall_flow_userpic_raw/event_day={FORWARD_MONTH_END}'; set user_write_ugi:afs://kunpeng.afs.baidu.com:9902=lbs-huiyan,lbs-huiyan; insert overwrite directory 'afs://kunpeng.afs.baidu.com:9902/user/lbs-huiyan/warehouse/huiyan.db/map_huiyan_mall_userpic/event_type=monthly/event_day={FORWARD_MONTH_END}' using CSV options('compression'='GZIP', sep='\t', escapeQuotes=false) SELECT TRANSFORM(mall_id, ) USING 'python3 mall_userpic_streaming.py' AS(mall_id, ) FROM huiyan_ns.huiyan.map_huiyan_mall_userpic_raw WHERE event_day = '{FORWARD_MONTH_END}' ; alter table huiyan_ns.huiyan.map_huiyan_mall_userpic add partition(event_type='monthly', event_day='{FORWARD_MONTH_END}') location 'afs://kunpeng.afs.baidu.com:9902/user/lbs-huiyan/warehouse/huiyan.db/map_huiyan_mall_userpic/event_type=monthly/event_day=${FORWARD_MONTH_END}'; 将这两段代码合并为一段
07-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值